File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -203,10 +203,6 @@ class Tvdb extends ExternalAPI implements TvShowProvider {
203203 seasonNumber : number ;
204204 language ?: string ;
205205 } ) : Promise < TmdbSeasonWithEpisodes > {
206- if ( seasonNumber === 0 ) {
207- return this . createEmptySeasonResponse ( tvId ) ;
208- }
209-
210206 try {
211207 const tmdbTvShow = await this . tmdb . getTvShow ( { tvId, language } ) ;
212208
@@ -275,12 +271,12 @@ class Tvdb extends ExternalAPI implements TvShowProvider {
275271 }
276272
277273 const seasons = tvdbData . seasons
278- . filter (
279- ( season ) =>
280- season . number > 0 && season . type && season . type . type === 'official'
281- )
274+ . filter ( ( season ) => season . type && season . type . type === 'official' )
282275 . sort ( ( a , b ) => a . number - b . number )
283- . map ( ( season ) => this . createSeasonData ( season , tvdbData ) ) ;
276+ . map ( ( season ) => this . createSeasonData ( season , tvdbData ) )
277+ . filter (
278+ ( season ) => season && season . season_number >= 0
279+ ) as TmdbTvSeasonResult [ ] ;
284280
285281 return seasons ;
286282 }
@@ -289,13 +285,14 @@ class Tvdb extends ExternalAPI implements TvShowProvider {
289285 season : TvdbSeasonDetails ,
290286 tvdbData : TvdbTvDetails
291287 ) : TmdbTvSeasonResult {
292- if ( ! season . number ) {
288+ const seasonNumber = season . number ?? - 1 ;
289+ if ( seasonNumber < 0 ) {
293290 return {
294291 id : 0 ,
295292 episode_count : 0 ,
296293 name : '' ,
297294 overview : '' ,
298- season_number : 0 ,
295+ season_number : - 1 ,
299296 poster_path : '' ,
300297 air_date : '' ,
301298 } ;
You can’t perform that action at this time.
0 commit comments