Fix themoviedb weird absolute

This commit is contained in:
Zoe Roux 2024-05-01 19:20:53 +02:00
parent 36f6cd5631
commit 4602f4ee65
No known key found for this signature in database

View File

@ -662,13 +662,13 @@ class TheMovieDatabase(Provider):
start = next( start = next(
(x["episode_number"] for x in absgrp if x["season_number"] == season), None (x["episode_number"] for x in absgrp if x["season_number"] == season), None
) )
if start is not None and start <= episode_nbr: if start is None or start <= episode_nbr:
# add back the continuous number (imagine the user has one piece S21e31 raise ProviderError(
# but tmdb registered it as S21E831 since S21's first ep is 800 f"Could not guess absolute number of episode {show_id} s{season} e{episode_nbr}"
return await self.get_absolute_number(show_id, season, episode_nbr + start) )
raise ProviderError( # add back the continuous number (imagine the user has one piece S21e31
f"Could not guess absolute number of episode {show_id} s{season} e{episode_nbr}" # but tmdb registered it as S21E831 since S21's first ep is 800
) return await self.get_absolute_number(show_id, season, episode_nbr + start)
async def identify_collection(self, provider_id: str) -> Collection: async def identify_collection(self, provider_id: str) -> Collection:
languages = self.get_languages() languages = self.get_languages()