Merge pull request #196 from ltctceplrm/omdbapi
Add country, boxOffice and ageRating fields for movies and series
This commit is contained in:
commit
a685d821f5
4 changed files with 23 additions and 0 deletions
|
|
@ -119,6 +119,9 @@ export class MALAPI extends APIModel {
|
|||
image: result.images?.jpg?.image_url ?? '',
|
||||
|
||||
released: true,
|
||||
country: [],
|
||||
boxOffice: '',
|
||||
ageRating: result.rating ?? '',
|
||||
premiere: this.plugin.dateFormatter.format(result.aired?.from, this.apiDateFormat) ?? 'unknown',
|
||||
streamingServices: result.streaming?.map((x: any) => x.name) ?? [],
|
||||
|
||||
|
|
@ -151,6 +154,9 @@ export class MALAPI extends APIModel {
|
|||
image: result.images?.jpg?.image_url ?? '',
|
||||
|
||||
released: true,
|
||||
country: [],
|
||||
boxOffice: '',
|
||||
ageRating: result.rating ?? '',
|
||||
premiere: this.plugin.dateFormatter.format(result.aired?.from, this.apiDateFormat) ?? 'unknown',
|
||||
streamingServices: result.streaming?.map((x: any) => x.name) ?? [],
|
||||
|
||||
|
|
@ -181,6 +187,8 @@ export class MALAPI extends APIModel {
|
|||
image: result.images?.jpg?.image_url ?? '',
|
||||
|
||||
released: true,
|
||||
country: [],
|
||||
ageRating: result.rating ?? '',
|
||||
airedFrom: this.plugin.dateFormatter.format(result.aired?.from, this.apiDateFormat) ?? 'unknown',
|
||||
airedTo: this.plugin.dateFormatter.format(result.aired?.to, this.apiDateFormat) ?? 'unknown',
|
||||
airing: result.airing,
|
||||
|
|
|
|||
|
|
@ -154,6 +154,9 @@ export class OMDbAPI extends APIModel {
|
|||
image: result.Poster ? result.Poster.replace('_SX300', '_SX600') : '',
|
||||
|
||||
released: true,
|
||||
country: result.Country?.split(', ') ?? [],
|
||||
boxOffice: result.BoxOffice,
|
||||
ageRating: result.Rated,
|
||||
streamingServices: [],
|
||||
premiere: this.plugin.dateFormatter.format(result.Released, this.apiDateFormat) ?? 'unknown',
|
||||
|
||||
|
|
@ -184,6 +187,8 @@ export class OMDbAPI extends APIModel {
|
|||
image: result.Poster ? result.Poster.replace('_SX300', '_SX600') : '',
|
||||
|
||||
released: true,
|
||||
country: result.Country?.split(', ') ?? [],
|
||||
ageRating: result.Rated,
|
||||
streamingServices: [],
|
||||
airing: false,
|
||||
airedFrom: this.plugin.dateFormatter.format(result.Released, this.apiDateFormat) ?? 'unknown',
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ export class MovieModel extends MediaTypeModel {
|
|||
image: string;
|
||||
|
||||
released: boolean;
|
||||
country: string[];
|
||||
boxOffice: string;
|
||||
ageRating: string;
|
||||
streamingServices: string[];
|
||||
premiere: string;
|
||||
|
||||
|
|
@ -40,6 +43,9 @@ export class MovieModel extends MediaTypeModel {
|
|||
this.image = '';
|
||||
|
||||
this.released = false;
|
||||
this.country = [];
|
||||
this.boxOffice = '';
|
||||
this.ageRating = '';
|
||||
this.streamingServices = [];
|
||||
this.premiere = '';
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ export class SeriesModel extends MediaTypeModel {
|
|||
image: string;
|
||||
|
||||
released: boolean;
|
||||
country: string[];
|
||||
ageRating: string;
|
||||
streamingServices: string[];
|
||||
airing: boolean;
|
||||
airedFrom: string;
|
||||
|
|
@ -42,6 +44,8 @@ export class SeriesModel extends MediaTypeModel {
|
|||
this.image = '';
|
||||
|
||||
this.released = false;
|
||||
this.country = [];
|
||||
this.ageRating = '';
|
||||
this.streamingServices = [];
|
||||
this.airing = false;
|
||||
this.airedFrom = '';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue