mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-01 12:18:35 -05:00
feat(tv): tv seasons
tv seasons
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
TmdbSearchTvResponse,
|
||||
TmdbSeasonWithEpisodes,
|
||||
TmdbTvDetails,
|
||||
TmdbTvSeasonResult,
|
||||
TmdbUpcomingMoviesResponse,
|
||||
} from './interfaces';
|
||||
|
||||
@@ -271,6 +272,32 @@ class TheMovieDb extends ExternalAPI {
|
||||
}
|
||||
};
|
||||
|
||||
public getTvSeasons = async ({
|
||||
tvId,
|
||||
page = 1,
|
||||
language = 'en',
|
||||
}: {
|
||||
tvId: number;
|
||||
page: number;
|
||||
language?: string;
|
||||
}): Promise<TmdbTvSeasonResult[]> => {
|
||||
try {
|
||||
const data = await this.get<TmdbTvDetails>(
|
||||
`/tv/${tvId}`,
|
||||
{
|
||||
params: {
|
||||
page,
|
||||
language,
|
||||
},
|
||||
},
|
||||
43200
|
||||
);
|
||||
return data.seasons;
|
||||
} catch (e) {
|
||||
throw new Error(`[TMDb] Failed to fetch TV show seasons: ${e.message}`);
|
||||
}
|
||||
};
|
||||
|
||||
public getTvSeason = async ({
|
||||
tvId,
|
||||
seasonNumber,
|
||||
|
||||
Reference in New Issue
Block a user