feat(ui): added content ratings for tv shows and movie ratings (#878)

This commit is contained in:
Danshil Mungur
2021-02-09 12:24:07 +04:00
committed by GitHub
parent 4e03c1efcf
commit c8b2a57721
8 changed files with 138 additions and 6 deletions

View File

@@ -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,

View File

@@ -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,