Fixed year field for moby api

This commit is contained in:
ltctceplrm 2024-01-27 02:00:48 +01:00 committed by GitHub
parent 4ec494dbb3
commit d2d6d346ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,6 +7,7 @@ import { MediaType } from '../../utils/MediaType';
export class MobyGamesAPI extends APIModel {
plugin: MediaDbPlugin;
apiDateFormat: string = 'YYYY-DD-MM';
constructor(plugin: MediaDbPlugin) {
super();
@ -46,7 +47,7 @@ export class MobyGamesAPI extends APIModel {
type: MediaType.Game,
title: 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,
id: result.game_id,
@ -78,7 +79,7 @@ export class MobyGamesAPI extends APIModel {
type: MediaType.Game,
title: 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,
url: `https://www.mobygames.com/game/${result.game_id}`,
id: result.game_id,