Handle case where we don't get back valid data from trakt

This commit is contained in:
Joe Breu 2014-08-01 12:26:36 -05:00
parent dbc30c43cb
commit 9bcd914ef2

View file

@ -148,13 +148,16 @@ class TraktChecker():
self.addDefaultShow(indexer, indexer_id, show["title"], SKIPPED) self.addDefaultShow(indexer, indexer_id, show["title"], SKIPPED)
newShow = helpers.findCertainShow(sickbeard.showList, indexer_id) newShow = helpers.findCertainShow(sickbeard.showList, indexer_id)
if newShow and int(newShow['indexer']) == indexer: try:
for episode in show["episodes"]: if newShow and int(newShow['indexer']) == indexer:
if newShow is not None: for episode in show["episodes"]:
self.setEpisodeToWanted(newShow, episode["season"], episode["number"]) if newShow is not None:
else: self.setEpisodeToWanted(newShow, episode["season"], episode["number"])
self.todoWanted.append((indexer_id, episode["season"], episode["number"])) else:
self.startBacklog(newShow) 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): def addDefaultShow(self, indexer, indexer_id, name, status):
""" """