diff --git a/sickbeard/dailysearcher.py b/sickbeard/dailysearcher.py index 221b6b8d..f64766d9 100644 --- a/sickbeard/dailysearcher.py +++ b/sickbeard/dailysearcher.py @@ -49,9 +49,17 @@ class DailySearcher(): [common.UNAIRED, curDate]) sql_l = [] + show = None + for sqlEp in sqlResults: + 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: logger.log(u"ERROR: expected to find a single show matching " + sqlEp["showid"]) continue diff --git a/sickbeard/search_queue.py b/sickbeard/search_queue.py index 59a430ae..f021bdb7 100644 --- a/sickbeard/search_queue.py +++ b/sickbeard/search_queue.py @@ -82,17 +82,19 @@ class SearchQueue(generic_queue.GenericQueue): # daily searches generic_queue.GenericQueue.add_item(self, item) 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 generic_queue.GenericQueue.add_item(self, item) 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 generic_queue.GenericQueue.add_item(self, item) else: 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): def __init__(self):