Skip to content

Commit

Permalink
Merge pull request #195 from larsenv/master
Browse files Browse the repository at this point in the history
Fix divide by zero error
  • Loading branch information
Drazzilb08 authored Nov 19, 2024
2 parents ce2bc8e + 6e33868 commit c036125
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/upgradinatorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ def filter_media(media_dict, checked_tag_id, ignore_tag_id, count, season_monito
if episode['monitored']:
monitored_count += 1
# Change monitoring of season depending on how many unmonitored episodes there are
monitored_percentage = monitored_count / len(season['episode_data'])
if len(season["episode_data"]) > 0:
monitored_percentage = monitored_count / len(season['episode_data'])
else:
continue
if monitored_percentage < season_monitored_threshold:
item['seasons'][i]['monitored'] = False
logger.debug(f"{item['title']}, Season {i} unmonitored. Reason: monitored percentage {monitored_percentage} less than season_monitored_threshold {season_monitored_threshold}")
Expand Down

0 comments on commit c036125

Please sign in to comment.