Fixed year field for moby api
This commit is contained in:
parent
4ec494dbb3
commit
d2d6d346ec
1 changed files with 3 additions and 2 deletions
|
|
@ -7,6 +7,7 @@ import { MediaType } from '../../utils/MediaType';
|
||||||
|
|
||||||
export class MobyGamesAPI extends APIModel {
|
export class MobyGamesAPI extends APIModel {
|
||||||
plugin: MediaDbPlugin;
|
plugin: MediaDbPlugin;
|
||||||
|
apiDateFormat: string = 'YYYY-DD-MM';
|
||||||
|
|
||||||
constructor(plugin: MediaDbPlugin) {
|
constructor(plugin: MediaDbPlugin) {
|
||||||
super();
|
super();
|
||||||
|
|
@ -46,7 +47,7 @@ export class MobyGamesAPI extends APIModel {
|
||||||
type: MediaType.Game,
|
type: MediaType.Game,
|
||||||
title: result.title,
|
title: result.title,
|
||||||
englishTitle: result.title,
|
englishTitle: result.title,
|
||||||
year: result.platforms[0].first_release_date ?? '',
|
year: new Date(result.platforms[0].first_release_date).getFullYear().toString(),
|
||||||
dataSource: this.apiName,
|
dataSource: this.apiName,
|
||||||
id: result.game_id,
|
id: result.game_id,
|
||||||
|
|
||||||
|
|
@ -78,7 +79,7 @@ export class MobyGamesAPI extends APIModel {
|
||||||
type: MediaType.Game,
|
type: MediaType.Game,
|
||||||
title: result.title,
|
title: result.title,
|
||||||
englishTitle: result.title,
|
englishTitle: result.title,
|
||||||
year: result.platforms[0].first_release_date,
|
year: new Date(result.platforms[0].first_release_date).getFullYear().toString(),
|
||||||
dataSource: this.apiName,
|
dataSource: this.apiName,
|
||||||
url: `https://www.mobygames.com/game/${result.game_id}`,
|
url: `https://www.mobygames.com/game/${result.game_id}`,
|
||||||
id: result.game_id,
|
id: result.game_id,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue