Skip to content

Commit d2d6d34

Browse files
authored
Fixed year field for moby api
1 parent 4ec494d commit d2d6d34

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/api/apis/MobyGamesAPI.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { MediaType } from '../../utils/MediaType';
77

88
export class MobyGamesAPI extends APIModel {
99
plugin: MediaDbPlugin;
10+
apiDateFormat: string = 'YYYY-DD-MM';
1011

1112
constructor(plugin: MediaDbPlugin) {
1213
super();
@@ -46,7 +47,7 @@ export class MobyGamesAPI extends APIModel {
4647
type: MediaType.Game,
4748
title: result.title,
4849
englishTitle: result.title,
49-
year: result.platforms[0].first_release_date ?? '',
50+
year: new Date(result.platforms[0].first_release_date).getFullYear().toString(),
5051
dataSource: this.apiName,
5152
id: result.game_id,
5253

@@ -78,7 +79,7 @@ export class MobyGamesAPI extends APIModel {
7879
type: MediaType.Game,
7980
title: result.title,
8081
englishTitle: result.title,
81-
year: result.platforms[0].first_release_date,
82+
year: new Date(result.platforms[0].first_release_date).getFullYear().toString(),
8283
dataSource: this.apiName,
8384
url: `https://www.mobygames.com/game/${result.game_id}`,
8485
id: result.game_id,

0 commit comments

Comments
 (0)