From 9fe6b664753d173a546a581d31d1e96ff7f414ae Mon Sep 17 00:00:00 2001 From: echel0n Date: Sat, 19 Jul 2014 06:10:02 -0700 Subject: [PATCH] Forgot to commit these --- sickbeard/helpers.py | 4 ++-- sickbeard/name_cache.py | 6 ++++-- sickbeard/postProcessor.py | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 9ce73eba..6bc3cc0c 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -1069,10 +1069,10 @@ def _check_against_names(nameInQuestion, show, season=-1): return False -def get_show_by_name(name, useIndexer=False): +def get_show(name, indexer_id=0, useIndexer=False): try: # check cache for show - showObj = sickbeard.name_cache.retrieveShowFromCache(name) + showObj = sickbeard.name_cache.retrieveShowFromCache(name, indexer_id=indexer_id) if showObj: return showObj diff --git a/sickbeard/name_cache.py b/sickbeard/name_cache.py index 06bd82a5..d1ad28e9 100644 --- a/sickbeard/name_cache.py +++ b/sickbeard/name_cache.py @@ -56,10 +56,12 @@ def retrieveNameFromCache(name): return int(nameCache[name]) -def retrieveShowFromCache(name): +def retrieveShowFromCache(name, indexer_id=0): global nameCache - indexer_id = retrieveNameFromCache(name) + if not indexer_id: + indexer_id = retrieveNameFromCache(name) + if indexer_id: return sickbeard.helpers.findCertainShow(sickbeard.showList, int(indexer_id)) diff --git a/sickbeard/postProcessor.py b/sickbeard/postProcessor.py index 9a78734c..bab606b1 100644 --- a/sickbeard/postProcessor.py +++ b/sickbeard/postProcessor.py @@ -523,7 +523,7 @@ class PostProcessor(object): indexer_id = name_cache.retrieveNameFromCache(name) if not indexer_id: - show = helpers.get_show_by_name(name) + show = helpers.get_show(name) if show: indexer_id = show.indexerid else: