From 80a6ac0c80c519a1409584d9c2b918886e447233 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 24 Dec 2023 12:29:11 +0100 Subject: [PATCH] Fix absolute episodes scanning --- scanner/providers/implementations/themoviedatabase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scanner/providers/implementations/themoviedatabase.py b/scanner/providers/implementations/themoviedatabase.py index c2bfb0ab..6a37349f 100644 --- a/scanner/providers/implementations/themoviedatabase.py +++ b/scanner/providers/implementations/themoviedatabase.py @@ -390,9 +390,9 @@ class TheMovieDatabase(Provider): and (season is None or episode_nbr is None) and show_id in self.absolute_episode_cache and self.absolute_episode_cache[show_id] is not None - and absolute in self.absolute_episode_cache[show_id] - ): # Using absolute - 1 since the array is 0based (absolute episode 1 is at index 0) + and len(self.absolute_episode_cache[show_id]) >= absolute + ): season = self.absolute_episode_cache[show_id][absolute - 1]["season_number"] episode_nbr = self.absolute_episode_cache[show_id][absolute - 1][ "episode_number"