From 9bcd914ef25be012f3da4526de90f83a9f75020b Mon Sep 17 00:00:00 2001 From: Joe Breu Date: Fri, 1 Aug 2014 12:26:36 -0500 Subject: [PATCH] Handle case where we don't get back valid data from trakt --- sickbeard/traktChecker.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/sickbeard/traktChecker.py b/sickbeard/traktChecker.py index c9a138d3..0e1fd0b6 100644 --- a/sickbeard/traktChecker.py +++ b/sickbeard/traktChecker.py @@ -148,13 +148,16 @@ class TraktChecker(): self.addDefaultShow(indexer, indexer_id, show["title"], SKIPPED) newShow = helpers.findCertainShow(sickbeard.showList, indexer_id) - if newShow and int(newShow['indexer']) == indexer: - for episode in show["episodes"]: - if newShow is not None: - self.setEpisodeToWanted(newShow, episode["season"], episode["number"]) - else: - self.todoWanted.append((indexer_id, episode["season"], episode["number"])) - self.startBacklog(newShow) + try: + if newShow and int(newShow['indexer']) == indexer: + for episode in show["episodes"]: + if newShow is not None: + self.setEpisodeToWanted(newShow, episode["season"], episode["number"]) + else: + self.todoWanted.append((indexer_id, episode["season"], episode["number"])) + self.startBacklog(newShow) + except TypeError: + logger.log(u"Could not parse the output from trakt for " + show["title"], logger.DEBUG) def addDefaultShow(self, indexer, indexer_id, name, status): """ @@ -233,4 +236,4 @@ class TraktChecker(): for season in segment[1]: logger.log(u"Starting backlog for " + show.name + " season " + str( season) + " because some eps were set to wanted") - self.todoBacklog.remove(segment) \ No newline at end of file + self.todoBacklog.remove(segment)