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