Fixed DailySearchQueueItem show attribute error during searches

This commit is contained in:
echel0n 2014-09-06 22:01:24 -07:00
parent 59675f27ac
commit 3efa9709af
2 changed files with 15 additions and 5 deletions

View file

@ -49,9 +49,17 @@ class DailySearcher():
[common.UNAIRED, curDate]) [common.UNAIRED, curDate])
sql_l = [] sql_l = []
show = None
for sqlEp in sqlResults: for sqlEp in sqlResults:
try: try:
show = helpers.findCertainShow(sickbeard.showList, int(sqlEp["showid"])) if not show or (show and int(sqlEp["showid"]) != show.indexerid):
show = helpers.findCertainShow(sickbeard.showList, int(sqlEp["showid"]))
# build name cache for show
sickbeard.name_cache.buildNameCache(show)
except exceptions.MultipleShowObjectsException: except exceptions.MultipleShowObjectsException:
logger.log(u"ERROR: expected to find a single show matching " + sqlEp["showid"]) logger.log(u"ERROR: expected to find a single show matching " + sqlEp["showid"])
continue continue

View file

@ -82,17 +82,19 @@ class SearchQueue(generic_queue.GenericQueue):
# daily searches # daily searches
generic_queue.GenericQueue.add_item(self, item) generic_queue.GenericQueue.add_item(self, item)
elif isinstance(item, BacklogQueueItem) and not self.is_in_queue(item.show, item.segment): elif isinstance(item, BacklogQueueItem) and not self.is_in_queue(item.show, item.segment):
# build name cache for show
sickbeard.name_cache.buildNameCache(item.show)
# backlog searches # backlog searches
generic_queue.GenericQueue.add_item(self, item) generic_queue.GenericQueue.add_item(self, item)
elif isinstance(item, (ManualSearchQueueItem, FailedQueueItem)) and not self.is_ep_in_queue(item.segment): elif isinstance(item, (ManualSearchQueueItem, FailedQueueItem)) and not self.is_ep_in_queue(item.segment):
# build name cache for show
sickbeard.name_cache.buildNameCache(item.show)
# manual and failed searches # manual and failed searches
generic_queue.GenericQueue.add_item(self, item) generic_queue.GenericQueue.add_item(self, item)
else: else:
logger.log(u"Not adding item, it's already in the queue", logger.DEBUG) logger.log(u"Not adding item, it's already in the queue", logger.DEBUG)
return
# build name cache for show
sickbeard.name_cache.buildNameCache(item.show)
class DailySearchQueueItem(generic_queue.QueueItem): class DailySearchQueueItem(generic_queue.QueueItem):
def __init__(self): def __init__(self):