mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-03 13:18:53 -05:00
fix(tvdb): return specials seasons (#1894)
This commit is contained in:
@@ -203,10 +203,6 @@ class Tvdb extends ExternalAPI implements TvShowProvider {
|
|||||||
seasonNumber: number;
|
seasonNumber: number;
|
||||||
language?: string;
|
language?: string;
|
||||||
}): Promise<TmdbSeasonWithEpisodes> {
|
}): Promise<TmdbSeasonWithEpisodes> {
|
||||||
if (seasonNumber === 0) {
|
|
||||||
return this.createEmptySeasonResponse(tvId);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const tmdbTvShow = await this.tmdb.getTvShow({ tvId, language });
|
const tmdbTvShow = await this.tmdb.getTvShow({ tvId, language });
|
||||||
|
|
||||||
@@ -275,12 +271,12 @@ class Tvdb extends ExternalAPI implements TvShowProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const seasons = tvdbData.seasons
|
const seasons = tvdbData.seasons
|
||||||
.filter(
|
.filter((season) => season.type && season.type.type === 'official')
|
||||||
(season) =>
|
|
||||||
season.number > 0 && season.type && season.type.type === 'official'
|
|
||||||
)
|
|
||||||
.sort((a, b) => a.number - b.number)
|
.sort((a, b) => a.number - b.number)
|
||||||
.map((season) => this.createSeasonData(season, tvdbData));
|
.map((season) => this.createSeasonData(season, tvdbData))
|
||||||
|
.filter(
|
||||||
|
(season) => season && season.season_number >= 0
|
||||||
|
) as TmdbTvSeasonResult[];
|
||||||
|
|
||||||
return seasons;
|
return seasons;
|
||||||
}
|
}
|
||||||
@@ -289,13 +285,14 @@ class Tvdb extends ExternalAPI implements TvShowProvider {
|
|||||||
season: TvdbSeasonDetails,
|
season: TvdbSeasonDetails,
|
||||||
tvdbData: TvdbTvDetails
|
tvdbData: TvdbTvDetails
|
||||||
): TmdbTvSeasonResult {
|
): TmdbTvSeasonResult {
|
||||||
if (!season.number) {
|
const seasonNumber = season.number ?? -1;
|
||||||
|
if (seasonNumber < 0) {
|
||||||
return {
|
return {
|
||||||
id: 0,
|
id: 0,
|
||||||
episode_count: 0,
|
episode_count: 0,
|
||||||
name: '',
|
name: '',
|
||||||
overview: '',
|
overview: '',
|
||||||
season_number: 0,
|
season_number: -1,
|
||||||
poster_path: '',
|
poster_path: '',
|
||||||
air_date: '',
|
air_date: '',
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user