Merge pull request #122 from ltctceplrm/master
Added developers and publishers field to games
This commit is contained in:
commit
9ca51ffc59
5 changed files with 11 additions and 3 deletions
|
|
@ -105,7 +105,7 @@ export class MALAPIManga extends APIModel {
|
|||
url: result.url,
|
||||
id: result.mal_id,
|
||||
|
||||
plot: result.synopsis,
|
||||
plot: (result.synopsis ?? 'unknown').replace(/"/g, "'") ?? 'unknown',
|
||||
genres: result.genres?.map((x: any) => x.name) ?? [],
|
||||
authors: result.authors?.map((x: any) => x.name) ?? [],
|
||||
chapters: result.chapters,
|
||||
|
|
|
|||
|
|
@ -200,6 +200,8 @@ export class OMDbAPI extends APIModel {
|
|||
url: `https://www.imdb.com/title/${result.imdbID}/`,
|
||||
id: result.imdbID,
|
||||
|
||||
developers: [],
|
||||
publishers: [],
|
||||
genres: result.Genre?.split(', ') ?? [],
|
||||
onlineRating: Number.parseFloat(result.imdbRating ?? 0),
|
||||
image: result.Poster ?? '',
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ export class OpenLibraryAPI extends APIModel {
|
|||
dataSource: this.apiName,
|
||||
url: `https://openlibrary.org` + result.key,
|
||||
id: result.key,
|
||||
isbn: result.isbn.find((el: string | any[]) => el.length <= 10) ?? 'unknown',
|
||||
isbn13: result.isbn.find((el: string | any[]) => el.length == 13) ?? 'unknown',
|
||||
isbn: (result.isbn ?? []).find((el: string | any[]) => el.length <= 10) ?? 'unknown',
|
||||
isbn13: (result.isbn ?? []).find((el: string | any[]) => el.length == 13) ?? 'unknown',
|
||||
englishTitle: result.title_english ?? result.title,
|
||||
|
||||
author: result.author_name ?? 'unknown',
|
||||
|
|
|
|||
|
|
@ -105,6 +105,8 @@ export class SteamAPI extends APIModel {
|
|||
url: `https://store.steampowered.com/app/${result.steam_appid}`,
|
||||
id: result.steam_appid,
|
||||
|
||||
developers: result['developers'],
|
||||
publishers: result['publishers'],
|
||||
genres: result.genres?.map((x: any) => x.description) ?? [],
|
||||
onlineRating: Number.parseFloat(result.metacritic?.score ?? 0),
|
||||
image: result.header_image ?? '',
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ import { mediaDbTag, migrateObject } from '../utils/Utils';
|
|||
import { MediaType } from '../utils/MediaType';
|
||||
|
||||
export class GameModel extends MediaTypeModel {
|
||||
developers: string[];
|
||||
publishers: string[];
|
||||
genres: string[];
|
||||
onlineRating: number;
|
||||
image: string;
|
||||
|
|
@ -18,6 +20,8 @@ export class GameModel extends MediaTypeModel {
|
|||
constructor(obj: any = {}) {
|
||||
super();
|
||||
|
||||
this.developers = undefined;
|
||||
this.publishers = undefined;
|
||||
this.genres = undefined;
|
||||
this.onlineRating = undefined;
|
||||
this.image = undefined;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue