From 6e33868be830c5bf36cfacf4d29a01562611de54 Mon Sep 17 00:00:00 2001 From: Larsen Vallecillo Date: Sun, 17 Nov 2024 19:28:57 -0600 Subject: [PATCH] Update upgradinatorr.py --- modules/upgradinatorr.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/upgradinatorr.py b/modules/upgradinatorr.py index c85c7da..3021bd7 100755 --- a/modules/upgradinatorr.py +++ b/modules/upgradinatorr.py @@ -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}")