Skip to content

Commit 9ca51ff

Browse files
Merge pull request #122 from ltctceplrm/master
Added developers and publishers field to games
2 parents 1424c0c + 93c46e5 commit 9ca51ff

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

src/api/apis/MALAPIManga.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class MALAPIManga extends APIModel {
105105
url: result.url,
106106
id: result.mal_id,
107107

108-
plot: result.synopsis,
108+
plot: (result.synopsis ?? 'unknown').replace(/"/g, "'") ?? 'unknown',
109109
genres: result.genres?.map((x: any) => x.name) ?? [],
110110
authors: result.authors?.map((x: any) => x.name) ?? [],
111111
chapters: result.chapters,

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/OpenLibraryAPI.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ export class OpenLibraryAPI extends APIModel {
7070
dataSource: this.apiName,
7171
url: `https://openlibrary.org` + result.key,
7272
id: result.key,
73-
isbn: result.isbn.find((el: string | any[]) => el.length <= 10) ?? 'unknown',
74-
isbn13: result.isbn.find((el: string | any[]) => el.length == 13) ?? 'unknown',
73+
isbn: (result.isbn ?? []).find((el: string | any[]) => el.length <= 10) ?? 'unknown',
74+
isbn13: (result.isbn ?? []).find((el: string | any[]) => el.length == 13) ?? 'unknown',
7575
englishTitle: result.title_english ?? result.title,
7676

7777
author: result.author_name ?? 'unknown',

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)