From d6950bc6f140884335dfcd5d92ea0b076d978d7a Mon Sep 17 00:00:00 2001 From: JackDandy Date: Fri, 31 Oct 2014 15:29:18 +0000 Subject: [PATCH] Fix exception raised when converting 12pm to 24hr format, also handles 12am. Triggered when setting file modify time (e.g. during PP and also scheduled show updates). --- CHANGES.md | 1 + sickbeard/tv.py | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 93404933..494250b3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -31,6 +31,7 @@ * Combined delete and remove buttons in to one on individual show pages * Other small UI tweaks * Fix keyerrors on backlog overview preventing the page to load +* Fix exception raised when converting 12pm to 24hr format and handle 12am when setting file modify time (e.g. used during PP) [develop changelog] * Improve display of progress bars in the Downloads columns of the show list page diff --git a/sickbeard/tv.py b/sickbeard/tv.py index 4468af9c..3af0ece8 100644 --- a/sickbeard/tv.py +++ b/sickbeard/tv.py @@ -2470,6 +2470,7 @@ class TVEpisode(object): if airs: hr = int(airs.group(1)) hr = (12 + hr, hr)[None is airs.group(3)] + hr = (hr, hr - 12)[0 == hr % 12] min = int((airs.group(2), min)[None is airs.group(2)]) airtime = datetime.time(hr, min)