Skip to content

Commit

Permalink
mediainfo_remap: Fix small bug in episode negative check
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkroot committed Oct 14, 2022
1 parent 836ad3e commit 761a92f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion trakt_scrobbler/mediainfo_remap.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ def apply(self, path: str, orig_info: dict):
# single episode, directly apply delta
ep = int(media_info['episode']) + self.episode_delta

if (isinstance(ep, int) and ep < 0) or any(epnum < 0 for epnum in ep):
if (isinstance(ep, int) and ep < 0) or (
isinstance(ep, list) and any(epnum < 0 for epnum in ep)
):
logger.error(f"Negative episode {ep} in {media_info}! rule={self}")
return None
media_info['episode'] = ep
Expand Down

0 comments on commit 761a92f

Please sign in to comment.