From d1d902597158e7c39149573615845e97e70aadf5 Mon Sep 17 00:00:00 2001 From: Nils Vogels Date: Mon, 5 May 2014 01:10:51 +0200 Subject: [PATCH 1/2] Fixing error in findpropers when air-by-date search is attempted, but show is not air-by-date --- sickbeard/properFinder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sickbeard/properFinder.py b/sickbeard/properFinder.py index c37ac1eb..e65d1efa 100644 --- a/sickbeard/properFinder.py +++ b/sickbeard/properFinder.py @@ -182,7 +182,8 @@ class ProperFinder(): logger.log( u"Looks like this is an air-by-date or sports show, attempting to convert the date to season/episode", logger.DEBUG) - airdate = curProper.airdate.toordinal() + if curProper.airdate: + airdate = curProper.airdate.toordinal() myDB = db.DBConnection() sql_result = myDB.select( "SELECT season, episode FROM tv_episodes WHERE showid = ? and indexer = ? and airdate = ?", From ffc2833c892362bed1f287a8d2676cff0b209711 Mon Sep 17 00:00:00 2001 From: Nils Vogels Date: Mon, 5 May 2014 01:12:47 +0200 Subject: [PATCH 2/2] Also trap if data is completely lacking --- sickbeard/properFinder.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sickbeard/properFinder.py b/sickbeard/properFinder.py index e65d1efa..f8f76cd6 100644 --- a/sickbeard/properFinder.py +++ b/sickbeard/properFinder.py @@ -184,6 +184,9 @@ class ProperFinder(): logger.DEBUG) if curProper.airdate: airdate = curProper.airdate.toordinal() + else: + airdate = None + myDB = db.DBConnection() sql_result = myDB.select( "SELECT season, episode FROM tv_episodes WHERE showid = ? and indexer = ? and airdate = ?",