1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Fixed issue with scene exception updating for custom names.

This commit is contained in:
echel0n 2014-05-30 05:30:28 -07:00
parent 9b78e3dc5e
commit 78c4211925
2 changed files with 14 additions and 6 deletions

View File

@ -73,4 +73,11 @@ class AddSceneExceptionsSeasons(AddSceneNameCache):
return self.hasColumn("scene_exceptions", "season")
def execute(self):
self.addColumn("scene_exceptions", "season", "NUMERIC", -1)
self.addColumn("scene_exceptions", "season", "NUMERIC", -1)
class AddSceneExceptionsCustom(AddSceneExceptionsSeasons):
def test(self):
return self.hasColumn("scene_exceptions", "custom")
def execute(self):
self.addColumn("scene_exceptions", "custom", "NUMERIC", 0)

View File

@ -216,13 +216,14 @@ def update_scene_exceptions(indexer_id, scene_exceptions):
myDB = db.DBConnection("cache.db")
myDB.action('DELETE FROM scene_exceptions WHERE indexer_id=?', [indexer_id])
myDB.action('DELETE FROM scene_exceptions WHERE indexer_id=? and custom=1', [indexer_id])
logger.log(u"Updating internal scene name cache", logger.MESSAGE)
for cur_exception, cur_season in scene_exceptions:
exceptionIndexerCache[helpers.full_sanitizeSceneName(cur_exception)] = indexer_id
myDB.action("INSERT INTO scene_exceptions (indexer_id, show_name, season) VALUES (?,?,?)",
[indexer_id, cur_exception, cur_season])
for cur_season in [-1] + sickbeard.scene_exceptions.get_scene_seasons(indexer_id):
for cur_exception in scene_exceptions:
exceptionIndexerCache[helpers.full_sanitizeSceneName(cur_exception)] = indexer_id
myDB.action("INSERT INTO scene_exceptions (indexer_id, show_name, season, custom) VALUES (?,?,?,?)",
[indexer_id, cur_exception, cur_season, 1])
name_cache.clearCache()