From b5e02829425ae73fecaf2e11e68e21334f574fd0 Mon Sep 17 00:00:00 2001 From: echel0n Date: Sun, 27 Jul 2014 07:14:41 -0700 Subject: [PATCH] Fixed scene exceptions issue when editing shows. --- sickbeard/scene_exceptions.py | 4 ++-- sickbeard/webserve.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sickbeard/scene_exceptions.py b/sickbeard/scene_exceptions.py index e39b0cd6..72063d65 100644 --- a/sickbeard/scene_exceptions.py +++ b/sickbeard/scene_exceptions.py @@ -252,7 +252,7 @@ def retrieve_exceptions(): anidb_exception_dict.clear() xem_exception_dict.clear() -def update_scene_exceptions(indexer_id, scene_exceptions): +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. """ @@ -267,7 +267,7 @@ def update_scene_exceptions(indexer_id, scene_exceptions): cur_exception = unicode(cur_exception, 'utf-8', 'replace') myDB.action("INSERT INTO scene_exceptions (indexer_id, show_name, season) VALUES (?,?,?)", - [indexer_id, cur_exception, -1]) + [indexer_id, cur_exception, season]) def _anidb_exceptions_fetcher(): global anidb_exception_dict diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index e677c733..1753b39d 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -3631,14 +3631,15 @@ class Home(MainHandler): return self._genericMessage("Error", errString) showObj = sickbeard.helpers.findCertainShow(sickbeard.showList, int(show)) - - if showObj is None: + if not showObj: errString = "Unable to find the specified show: " + str(show) if directCall: return [errString] else: return self._genericMessage("Error", errString) + showObj.exceptions = scene_exceptions.get_scene_exceptions(showObj.indexerid) + if not location and not anyQualities and not bestQualities and not flatten_folders: t = PageTemplate(headers=self.request.headers, file="editShow.tmpl") t.submenu = HomeMenu() @@ -3855,8 +3856,7 @@ class Home(MainHandler): if do_update_exceptions: try: - scene_exceptions.update_scene_exceptions(showObj.indexerid, exceptions_list) # @UndefinedVariable - showObj.exceptions = scene_exceptions.get_scene_exceptions(showObj.indexerid) + scene_exceptions.update_scene_exceptions(showObj.indexerid, exceptions_list) # @UndefinedVdexerid) time.sleep(cpu_presets[sickbeard.CPU_PRESET]) except exceptions.CantUpdateException, e: errors.append("Unable to force an update on scene exceptions of the show.")