Skip to content

Add country, boxOffice and ageRating fields for movies and series #196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/api/apis/MALAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) ?? [],

Expand Down Expand Up @@ -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) ?? [],

Expand Down Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions src/api/apis/OMDbAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Expand Down Expand Up @@ -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',
Expand Down
6 changes: 6 additions & 0 deletions src/models/MovieModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export class MovieModel extends MediaTypeModel {
image: string;

released: boolean;
country: string[];
boxOffice: string;
ageRating: string;
streamingServices: string[];
premiere: string;

Expand All @@ -40,6 +43,9 @@ export class MovieModel extends MediaTypeModel {
this.image = '';

this.released = false;
this.country = [];
this.boxOffice = '';
this.ageRating = '';
this.streamingServices = [];
this.premiere = '';

Expand Down
4 changes: 4 additions & 0 deletions src/models/SeriesModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export class SeriesModel extends MediaTypeModel {
image: string;

released: boolean;
country: string[];
ageRating: string;
streamingServices: string[];
airing: boolean;
airedFrom: string;
Expand All @@ -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 = '';
Expand Down