mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-31 19:59:31 -05:00
feat(ui): added content ratings for tv shows and movie ratings (#878)
This commit is contained in:
@@ -145,7 +145,7 @@ class TheMovieDb extends ExternalAPI {
|
||||
{
|
||||
params: {
|
||||
language,
|
||||
append_to_response: 'credits,external_ids,videos',
|
||||
append_to_response: 'credits,external_ids,videos,release_dates',
|
||||
},
|
||||
},
|
||||
43200
|
||||
@@ -171,7 +171,7 @@ class TheMovieDb extends ExternalAPI {
|
||||
params: {
|
||||
language,
|
||||
append_to_response:
|
||||
'aggregate_credits,credits,external_ids,keywords,videos',
|
||||
'aggregate_credits,credits,external_ids,keywords,videos,content_ratings',
|
||||
},
|
||||
},
|
||||
43200
|
||||
|
||||
@@ -136,6 +136,7 @@ export interface TmdbMovieDetails {
|
||||
name: string;
|
||||
}[];
|
||||
release_date: string;
|
||||
release_dates: TmdbMovieReleaseResult;
|
||||
revenue: number;
|
||||
runtime?: number;
|
||||
spoken_languages: {
|
||||
@@ -205,6 +206,7 @@ export interface TmdbTvSeasonResult {
|
||||
export interface TmdbTvDetails {
|
||||
id: number;
|
||||
backdrop_path?: string;
|
||||
content_ratings: TmdbTvRatingResult;
|
||||
created_by: {
|
||||
id: number;
|
||||
credit_id: string;
|
||||
@@ -272,6 +274,29 @@ export interface TmdbVideoResult {
|
||||
results: TmdbVideo[];
|
||||
}
|
||||
|
||||
export interface TmdbTvRatingResult {
|
||||
results: TmdbRating[];
|
||||
}
|
||||
|
||||
export interface TmdbRating {
|
||||
iso_3166_1: string;
|
||||
rating: string;
|
||||
}
|
||||
|
||||
export interface TmdbMovieReleaseResult {
|
||||
results: TmdbRelease[];
|
||||
}
|
||||
|
||||
export interface TmdbRelease extends TmdbRating {
|
||||
release_dates: {
|
||||
certification: string;
|
||||
iso_639_1?: string;
|
||||
note?: string;
|
||||
release_date: string;
|
||||
type: number;
|
||||
}[];
|
||||
}
|
||||
|
||||
export interface TmdbKeyword {
|
||||
id: number;
|
||||
name: string;
|
||||
@@ -316,6 +341,7 @@ export interface TmdbPersonCredit {
|
||||
adult: boolean;
|
||||
release_date: string;
|
||||
}
|
||||
|
||||
export interface TmdbPersonCreditCast extends TmdbPersonCredit {
|
||||
character: string;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import type { TmdbMovieDetails } from '../api/themoviedb/interfaces';
|
||||
import type {
|
||||
TmdbMovieDetails,
|
||||
TmdbMovieReleaseResult,
|
||||
} from '../api/themoviedb/interfaces';
|
||||
import {
|
||||
ProductionCompany,
|
||||
Genre,
|
||||
@@ -48,6 +51,7 @@ export interface MovieDetails {
|
||||
name: string;
|
||||
}[];
|
||||
releaseDate: string;
|
||||
releases: TmdbMovieReleaseResult;
|
||||
revenue: number;
|
||||
runtime?: number;
|
||||
spokenLanguages: {
|
||||
@@ -95,6 +99,7 @@ export const mapMovieDetails = (
|
||||
})),
|
||||
productionCountries: movie.production_countries,
|
||||
releaseDate: movie.release_date,
|
||||
releases: movie.release_dates,
|
||||
revenue: movie.revenue,
|
||||
spokenLanguages: movie.spoken_languages,
|
||||
status: movie.status,
|
||||
|
||||
@@ -15,6 +15,7 @@ import type {
|
||||
TmdbTvSeasonResult,
|
||||
TmdbTvDetails,
|
||||
TmdbSeasonWithEpisodes,
|
||||
TmdbTvRatingResult,
|
||||
} from '../api/themoviedb/interfaces';
|
||||
import type Media from '../entity/Media';
|
||||
import { Video } from './Movie';
|
||||
@@ -58,6 +59,7 @@ export interface TvDetails {
|
||||
id: number;
|
||||
backdropPath?: string;
|
||||
posterPath?: string;
|
||||
contentRatings: TmdbTvRatingResult;
|
||||
createdBy: {
|
||||
id: number;
|
||||
name: string;
|
||||
@@ -174,6 +176,7 @@ export const mapTvDetails = (
|
||||
originCountry: company.origin_country,
|
||||
logoPath: company.logo_path,
|
||||
})),
|
||||
contentRatings: show.content_ratings,
|
||||
spokenLanguages: show.spoken_languages.map((language) => ({
|
||||
englishName: language.english_name,
|
||||
iso_639_1: language.iso_639_1,
|
||||
|
||||
Reference in New Issue
Block a user