Improved performance of RSS Cache updater

This commit is contained in:
echel0n 2014-05-13 00:03:10 -07:00
parent e353cd13c7
commit 9301d29433
2 changed files with 9 additions and 9 deletions

View file

@ -233,7 +233,6 @@ def pickBestResult(results, show, quality_list=None):
return bestResult return bestResult
def isFinalResult(result): def isFinalResult(result):
""" """
Checks if the given result is good enough quality that we can stop searching for other ones. Checks if the given result is good enough quality that we can stop searching for other ones.

View file

@ -245,7 +245,7 @@ class TVCache():
logger.log(u"No series name retrieved from " + name + ", unable to cache it", logger.DEBUG) logger.log(u"No series name retrieved from " + name + ", unable to cache it", logger.DEBUG)
return None return None
cacheResult = sickbeard.name_cache.retrieveNameFromCache(name) cacheResult = sickbeard.name_cache.retrieveNameFromCache(parse_result.series_name)
if cacheResult: if cacheResult:
in_cache = True in_cache = True
indexerid = int(cacheResult) indexerid = int(cacheResult)
@ -255,11 +255,12 @@ class TVCache():
if showResult: if showResult:
indexerid = int(showResult[0]) indexerid = int(showResult[0])
if not indexerid: # if not indexerid:
for curShow in sickbeard.showList: # for curShow in sickbeard.showList:
if show_name_helpers.isGoodResult(name, curShow, False): # if curShow.name == parse_result.series_name:
indexerid = int(curShow.indexerid) # if show_name_helpers.isGoodResult(name, curShow, False):
break # indexerid = int(curShow.indexerid)
# break
showObj = None showObj = None
if indexerid: if indexerid:
@ -281,7 +282,7 @@ class TVCache():
season = int(sql_results[0]["season"]) season = int(sql_results[0]["season"])
episodes = [int(sql_results[0]["episode"])] episodes = [int(sql_results[0]["episode"])]
else: else:
season = parse_result.season_number season = parse_result.season_number if parse_result.season_number != None else 1
episodes = parse_result.episode_numbers episodes = parse_result.episode_numbers
if season and episodes: if season and episodes:
@ -301,7 +302,7 @@ class TVCache():
logger.log(u"Added RSS item: [" + name + "] to cache: [" + self.providerID + "]", logger.DEBUG) logger.log(u"Added RSS item: [" + name + "] to cache: [" + self.providerID + "]", logger.DEBUG)
if not in_cache: if not in_cache:
sickbeard.name_cache.addNameToCache(name, indexerid) sickbeard.name_cache.addNameToCache(parse_result.series_name, indexerid)
return [ return [
"INSERT INTO [" + self.providerID + "] (name, season, episodes, indexerid, url, time, quality) VALUES (?,?,?,?,?,?,?)", "INSERT INTO [" + self.providerID + "] (name, season, episodes, indexerid, url, time, quality) VALUES (?,?,?,?,?,?,?)",