fix(tvdb): return specials seasons (#1894)

This commit is contained in:
THOMAS B
2025-09-08 10:49:26 +02:00
committed by GitHub
parent d82c6f6222
commit 6245dae3b3

View File

@@ -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: '',
}; };