Replaced the producer field by director and added writer and studio fields
This commit is contained in:
parent
18f4412158
commit
5f6f875b86
4 changed files with 23 additions and 9 deletions
|
|
@ -110,7 +110,9 @@ export class MALAPI extends APIModel {
|
||||||
|
|
||||||
plot: result.synopsis,
|
plot: result.synopsis,
|
||||||
genres: result.genres?.map((x: any) => x.name) ?? [],
|
genres: result.genres?.map((x: any) => x.name) ?? [],
|
||||||
producer: result.studios?.map((x: any) => x.name).join(', ') ?? 'unknown',
|
director: [],
|
||||||
|
writer: [],
|
||||||
|
studio: result.studios?.map((x: any) => x.name).join(', ') ?? 'unknown',
|
||||||
duration: result.duration ?? 'unknown',
|
duration: result.duration ?? 'unknown',
|
||||||
onlineRating: result.score ?? 0,
|
onlineRating: result.score ?? 0,
|
||||||
actors: [],
|
actors: [],
|
||||||
|
|
@ -142,7 +144,9 @@ export class MALAPI extends APIModel {
|
||||||
|
|
||||||
plot: result.synopsis,
|
plot: result.synopsis,
|
||||||
genres: result.genres?.map((x: any) => x.name) ?? [],
|
genres: result.genres?.map((x: any) => x.name) ?? [],
|
||||||
producer: result.studios?.map((x: any) => x.name).join(', ') ?? 'unknown',
|
director: [],
|
||||||
|
writer: [],
|
||||||
|
studio: result.studios?.map((x: any) => x.name).join(', ') ?? 'unknown',
|
||||||
duration: result.duration ?? 'unknown',
|
duration: result.duration ?? 'unknown',
|
||||||
onlineRating: result.score ?? 0,
|
onlineRating: result.score ?? 0,
|
||||||
actors: [],
|
actors: [],
|
||||||
|
|
@ -171,7 +175,8 @@ export class MALAPI extends APIModel {
|
||||||
id: result.mal_id,
|
id: result.mal_id,
|
||||||
|
|
||||||
genres: result.genres?.map((x: any) => x.name) ?? [],
|
genres: result.genres?.map((x: any) => x.name) ?? [],
|
||||||
studios: result.studios?.map((x: any) => x.name) ?? [],
|
writer: [],
|
||||||
|
studio: result.studios?.map((x: any) => x.name) ?? [],
|
||||||
episodes: result.episodes,
|
episodes: result.episodes,
|
||||||
duration: result.duration ?? 'unknown',
|
duration: result.duration ?? 'unknown',
|
||||||
onlineRating: result.score ?? 0,
|
onlineRating: result.score ?? 0,
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,9 @@ export class OMDbAPI extends APIModel {
|
||||||
|
|
||||||
plot: result.Plot ?? '',
|
plot: result.Plot ?? '',
|
||||||
genres: result.Genre?.split(', ') ?? [],
|
genres: result.Genre?.split(', ') ?? [],
|
||||||
producer: result.Director ?? 'unknown',
|
director: result.Director?.split(', ') ?? [],
|
||||||
|
writer: result.Writer?.split(', ') ?? [],
|
||||||
|
studio: ['N/A'],
|
||||||
duration: result.Runtime ?? 'unknown',
|
duration: result.Runtime ?? 'unknown',
|
||||||
onlineRating: Number.parseFloat(result.imdbRating ?? 0),
|
onlineRating: Number.parseFloat(result.imdbRating ?? 0),
|
||||||
actors: result.Actors?.split(', ') ?? [],
|
actors: result.Actors?.split(', ') ?? [],
|
||||||
|
|
@ -166,7 +168,8 @@ export class OMDbAPI extends APIModel {
|
||||||
|
|
||||||
plot: result.Plot ?? '',
|
plot: result.Plot ?? '',
|
||||||
genres: result.Genre?.split(', ') ?? [],
|
genres: result.Genre?.split(', ') ?? [],
|
||||||
studios: [result.Director] ?? 'unknown',
|
writer: result.Writer?.split(', ') ?? [],
|
||||||
|
studio: [],
|
||||||
episodes: 0,
|
episodes: 0,
|
||||||
duration: result.Runtime ?? 'unknown',
|
duration: result.Runtime ?? 'unknown',
|
||||||
onlineRating: Number.parseFloat(result.imdbRating ?? 0),
|
onlineRating: Number.parseFloat(result.imdbRating ?? 0),
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@ import { MediaType } from '../utils/MediaType';
|
||||||
export class MovieModel extends MediaTypeModel {
|
export class MovieModel extends MediaTypeModel {
|
||||||
plot: string;
|
plot: string;
|
||||||
genres: string[];
|
genres: string[];
|
||||||
producer: string;
|
director: string[];
|
||||||
|
writer: string[];
|
||||||
|
studio: string[];
|
||||||
duration: string;
|
duration: string;
|
||||||
onlineRating: number;
|
onlineRating: number;
|
||||||
actors: string[];
|
actors: string[];
|
||||||
|
|
@ -26,7 +28,9 @@ export class MovieModel extends MediaTypeModel {
|
||||||
|
|
||||||
this.plot = undefined;
|
this.plot = undefined;
|
||||||
this.genres = undefined;
|
this.genres = undefined;
|
||||||
this.producer = undefined;
|
this.director = undefined;
|
||||||
|
this.writer = undefined;
|
||||||
|
this.studio = undefined;
|
||||||
this.duration = undefined;
|
this.duration = undefined;
|
||||||
this.onlineRating = undefined;
|
this.onlineRating = undefined;
|
||||||
this.actors = undefined;
|
this.actors = undefined;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@ export class SeriesModel extends MediaTypeModel {
|
||||||
|
|
||||||
plot: string;
|
plot: string;
|
||||||
genres: string[];
|
genres: string[];
|
||||||
studios: string[];
|
writer: string[];
|
||||||
|
studio: string[];
|
||||||
episodes: number;
|
episodes: number;
|
||||||
duration: string;
|
duration: string;
|
||||||
onlineRating: number;
|
onlineRating: number;
|
||||||
|
|
@ -38,7 +39,8 @@ export class SeriesModel extends MediaTypeModel {
|
||||||
|
|
||||||
this.plot = undefined;
|
this.plot = undefined;
|
||||||
this.genres = undefined;
|
this.genres = undefined;
|
||||||
this.studios = undefined;
|
this.writer = undefined;
|
||||||
|
this.studio = undefined;
|
||||||
this.episodes = undefined;
|
this.episodes = undefined;
|
||||||
this.duration = undefined;
|
this.duration = undefined;
|
||||||
this.onlineRating = undefined;
|
this.onlineRating = undefined;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue