1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-04 16:35:00 -05:00

Fix for scene exceptions error.

This commit is contained in:
echel0n 2014-06-30 06:36:20 -07:00
parent 4575c58348
commit 0e665cbbb2

View File

@ -52,34 +52,32 @@ def get_scene_exceptions(indexer_id, season=-1):
Given a indexer_id, return a list of all the scene exceptions.
"""
exceptionsList = {}
exceptionsList = []
myDB = db.DBConnection('cache.db')
exceptions = myDB.select("SELECT show_name FROM scene_exceptions WHERE indexer_id = ? and season = ?",
[indexer_id, season])
if exceptions:
exceptionsList = list(set([cur_exception["show_name"] for cur_exception in exceptions]))
if season == 1: # if we where looking for season 1 we can add generic names
exceptionsList += get_scene_exceptions(indexer_id, season=-1)
del exceptions
if season == 1: # if we where looking for season 1 we can add generic names
exceptionsList += get_scene_exceptions(indexer_id, season=-1)
return exceptionsList
def get_all_scene_exceptions(indexer_id):
exceptionsList = {}
exceptionsDict = {}
myDB = db.DBConnection('cache.db')
exceptions = myDB.select("SELECT show_name,season FROM scene_exceptions WHERE indexer_id = ?", [indexer_id])
if exceptions:
for cur_exception in exceptions:
if not cur_exception["season"] in exceptionsList:
exceptionsList[cur_exception["season"]] = []
exceptionsList[cur_exception["season"]].append(cur_exception["show_name"])
if not cur_exception["season"] in exceptionsDict:
exceptionsDict[cur_exception["season"]] = []
exceptionsDict[cur_exception["season"]].append(cur_exception["show_name"])
del exceptions
return exceptionsList
return exceptionsDict
def get_scene_seasons(indexer_id):
@ -127,9 +125,6 @@ def get_scene_exception_by_name_multiple(show_name):
logger.log(u"Scene exception lookup got indexer id " + str(cur_indexer_id) + u", using that", logger.DEBUG)
out.append((cur_indexer_id, cur_season))
# cleanup
del all_exception_results
if out:
return out
else: