Merge pull request #728 from rogierhelmer/dev

Scene exception list not updated, Double show names in scene excep list after manual scan
This commit is contained in:
echel0n 2014-08-17 17:59:31 -07:00
commit 69b5b3a251
3 changed files with 11 additions and 5 deletions

View file

@ -256,11 +256,17 @@ def update_scene_exceptions(indexer_id, scene_exceptions, season=-1):
"""
Given a indexer_id, and a list of all show scene exceptions, update the db.
"""
global exceptionsCache
myDB = db.DBConnection('cache.db')
myDB.action('DELETE FROM scene_exceptions WHERE indexer_id=?', [indexer_id])
logger.log(u"Updating scene exceptions", logger.MESSAGE)
# A change has been made to the scene exception list. Let's clear the cache, to make this visible
if indexer_id in exceptionsCache:
exceptionsCache[indexer_id] = {}
exceptionsCache[indexer_id][season] = scene_exceptions
for cur_exception in scene_exceptions:
if not isinstance(cur_exception, unicode):
@ -316,7 +322,7 @@ def _xem_exceptions_fetcher():
def getSceneSeasons(indexer_id):
"""get a list of season numbers that have scene excpetions
"""get a list of season numbers that have scene exceptions
"""
myDB = db.DBConnection('cache.db')
seasons = myDB.select("SELECT DISTINCT season FROM scene_exceptions WHERE indexer_id = ?", [indexer_id])

View file

@ -259,10 +259,10 @@ def allPossibleShowNames(show, season=-1):
Returns: a list of all the possible show names
"""
showNames = get_scene_exceptions(show.indexerid, season=season)
showNames = get_scene_exceptions(show.indexerid, season=season)[:]
if not showNames: # if we dont have any season specific exceptions fallback to generic exceptions
season = -1
showNames = get_scene_exceptions(show.indexerid, season=season)
showNames = get_scene_exceptions(show.indexerid, season=season)[:]
if season in [-1, 1]:
showNames.append(show.name)

View file

@ -556,7 +556,7 @@ def _getEpisode(show, season=None, episode=None, absolute=None):
return "Invalid show paramaters"
if absolute:
epObj = showObj.getEpisode(absolute=int(absolute))
epObj = showObj.getEpisode(absolute_number=int(absolute))
elif season and episode:
epObj = showObj.getEpisode(int(season), int(episode))
else: