From d39157f4a9adb3f07311827ed35735469c23275e Mon Sep 17 00:00:00 2001 From: JackDandy Date: Sun, 3 May 2015 17:24:08 +0100 Subject: [PATCH] Add handling for shows that do not have a total number of episodes. For rare case where a show can be in the db and added to the indexer and then the episodes removed from the indexer but not the show. --- CHANGES.md | 1 + sickbeard/webserve.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 41ae87cf..7862fa61 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -27,6 +27,7 @@ * Change to prevent another scheduled search when one of the same type is already running * Add custom show lists to home page * Change travis to new container builds for faster unit testing +* Add handling for shows that do not have a total number of episodes * Change values used for date sorting on home page and episode view for improved compatibility with posix systems diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 91b08c8b..f9043400 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -1131,7 +1131,8 @@ class Home(MainHandler): if highest_season < curResult['season'] and 1000 < curResult['airdate'] and UNAIRED < curResult['status']: highest_season = curResult['season'] - latest_season = int(sorted(epCounts['totals'])[-1::][0]) + if 0 < len(epCounts['totals']): + latest_season = int(sorted(epCounts['totals'])[-1::][0]) display_seasons = [] if 1 < highest_season: