Skip to content

Commit 8bb8c2d

Browse files
committed
Added developers and publishers field to games
OMDB doesn't have this field so I mapped it to be empty.
1 parent 1424c0c commit 8bb8c2d

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/api/apis/OMDbAPI.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ export class OMDbAPI extends APIModel {
200200
url: `https://www.imdb.com/title/${result.imdbID}/`,
201201
id: result.imdbID,
202202

203+
developers: [],
204+
publishers: [],
203205
genres: result.Genre?.split(', ') ?? [],
204206
onlineRating: Number.parseFloat(result.imdbRating ?? 0),
205207
image: result.Poster ?? '',

src/api/apis/SteamAPI.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ export class SteamAPI extends APIModel {
105105
url: `https://store.steampowered.com/app/${result.steam_appid}`,
106106
id: result.steam_appid,
107107

108+
developers: result['developers'],
109+
publishers: result['publishers'],
108110
genres: result.genres?.map((x: any) => x.description) ?? [],
109111
onlineRating: Number.parseFloat(result.metacritic?.score ?? 0),
110112
image: result.header_image ?? '',

src/models/GameModel.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { mediaDbTag, migrateObject } from '../utils/Utils';
33
import { MediaType } from '../utils/MediaType';
44

55
export class GameModel extends MediaTypeModel {
6+
developers: string[];
7+
publishers: string[];
68
genres: string[];
79
onlineRating: number;
810
image: string;
@@ -18,6 +20,8 @@ export class GameModel extends MediaTypeModel {
1820
constructor(obj: any = {}) {
1921
super();
2022

23+
this.developers = undefined;
24+
this.publishers = undefined;
2125
this.genres = undefined;
2226
this.onlineRating = undefined;
2327
this.image = undefined;

0 commit comments

Comments
 (0)