From 898e7b272e4c2977300b1c634ee53e68e45cb43f Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Tue, 30 Jan 2024 23:41:44 +0100 Subject: [PATCH] Fix absolute episode parsing when seasons are missing on tmdb --- scanner/providers/implementations/themoviedatabase.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scanner/providers/implementations/themoviedatabase.py b/scanner/providers/implementations/themoviedatabase.py index f3cea407..68844ec2 100644 --- a/scanner/providers/implementations/themoviedatabase.py +++ b/scanner/providers/implementations/themoviedatabase.py @@ -607,6 +607,10 @@ class TheMovieDatabase(Provider): # Dont forget to ingore the special season (season_number 0) seasons_nbrs = [x.season_number for x in show.seasons if x.season_number != 0] seasons_eps = [x.episodes_count for x in show.seasons if x.season_number != 0] + + if not any(seasons_nbrs): + return (None, None) + # zip_longest(seasons_nbrs[1:], accumulate(seasons_eps)) return [(2, 12), (None, 24)] if the show has two seasons with 12 eps # we take the last group that has less total episodes than the absolute number. return next(