diff --git a/src/domains/Tv/api/Details/index.ts b/src/domains/Tv/api/Details/index.ts index 082d0fc..431b5c5 100644 --- a/src/domains/Tv/api/Details/index.ts +++ b/src/domains/Tv/api/Details/index.ts @@ -121,6 +121,18 @@ const parseResponse = (tv: RawResponse): Response => { tagline: tv.tagline, runtime: `${tv.episode_run_time} min`, + seasonsCount: tv.number_of_seasons, + seasonsDescription: + tv.number_of_seasons > 1 + ? `${tv.number_of_seasons} temporadas` + : `${tv.number_of_seasons} temporada`, + + episodesCount: tv.number_of_episodes, + episodesDescription: + tv.number_of_episodes > 1 + ? `${tv.number_of_episodes} episódios` + : `${tv.number_of_episodes} episódio`, + creatorName: tv.created_by[0]?.name, releaseDate: getReleaseDate(tv), diff --git a/src/domains/Tv/api/Details/types/RawResponse.ts b/src/domains/Tv/api/Details/types/RawResponse.ts index 63f9275..0592344 100644 --- a/src/domains/Tv/api/Details/types/RawResponse.ts +++ b/src/domains/Tv/api/Details/types/RawResponse.ts @@ -24,6 +24,8 @@ export default interface RawResponse { vote_count: number; vote_average: number; created_by: any[]; + number_of_seasons: number; + number_of_episodes: number; credits?: Credits; recommendations?: { diff --git a/src/domains/Tv/api/Details/types/Response.ts b/src/domains/Tv/api/Details/types/Response.ts index e4218f0..5096cad 100644 --- a/src/domains/Tv/api/Details/types/Response.ts +++ b/src/domains/Tv/api/Details/types/Response.ts @@ -24,6 +24,11 @@ export default interface Response { voteAverage: number; creatorName: string; + seasonsCount: number; + seasonsDescription: string; + episodesCount: number; + episodesDescription: string; + recommendations?: Recommendations[]; images?: Images; credits?: Credits; diff --git a/src/pages/Tv/index.tsx b/src/pages/Tv/index.tsx index 60e984c..81400e5 100644 --- a/src/pages/Tv/index.tsx +++ b/src/pages/Tv/index.tsx @@ -102,7 +102,8 @@ const Tv: React.FC = () => { {tv.title} - {tv.releaseDate} | {tv.genresNames} | {tv.runtime} + {tv.releaseDate} | {tv.genresNames} |{' '} + {tv.seasonsDescription} | {tv.runtime} {tv.tagline && {`"${tv.tagline}"`}}