refactor: move genre/studio/network calls into their own endpoints

this commit also adds a `useDiscover` hook to help with creating discover pages with less repeating
code
This commit is contained in:
sct
2021-03-04 10:18:46 +00:00
parent ed0a7fbdf5
commit 63c122e5e0
23 changed files with 885 additions and 365 deletions

View File

@@ -109,6 +109,16 @@ export interface TmdbExternalIds {
twitter_id?: string;
}
export interface TmdbProductionCompany {
id: number;
logo_path?: string;
name: string;
origin_country: string;
homepage?: string;
headquarters?: string;
description?: string;
}
export interface TmdbMovieDetails {
id: number;
imdb_id?: string;
@@ -125,12 +135,7 @@ export interface TmdbMovieDetails {
original_title: string;
overview?: string;
popularity: number;
production_companies: {
id: number;
name: string;
logo_path?: string;
origin_country: string;
}[];
production_companies: TmdbProductionCompany[];
production_countries: {
iso_3166_1: string;
name: string;
@@ -227,12 +232,7 @@ export interface TmdbTvDetails {
last_episode_to_air?: TmdbTvEpisodeResult;
name: string;
next_episode_to_air?: TmdbTvEpisodeResult;
networks: {
id: number;
name: string;
logo_path: string;
origin_country: string;
}[];
networks: TmdbNetwork[];
number_of_episodes: number;
number_of_seasons: number;
origin_country: string[];
@@ -391,17 +391,6 @@ export interface TmdbGenre {
name: string;
}
export interface TmdbStudio {
id: number;
name: string;
description?: string;
headquarters?: string;
homepage?: string;
logo_path?: string;
origin_country?: string;
parent_company?: TmdbStudio;
}
export interface TmdbNetwork {
id: number;
name: string;