1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-13 19:42:20 -05:00

Fixed scene exceptions issue when editing shows.

This commit is contained in:
echel0n 2014-07-27 07:14:41 -07:00
parent 9493a8f7e5
commit b5e0282942
2 changed files with 6 additions and 6 deletions

View File

@ -252,7 +252,7 @@ def retrieve_exceptions():
anidb_exception_dict.clear() anidb_exception_dict.clear()
xem_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. 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') cur_exception = unicode(cur_exception, 'utf-8', 'replace')
myDB.action("INSERT INTO scene_exceptions (indexer_id, show_name, season) VALUES (?,?,?)", 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(): def _anidb_exceptions_fetcher():
global anidb_exception_dict global anidb_exception_dict

View File

@ -3631,14 +3631,15 @@ class Home(MainHandler):
return self._genericMessage("Error", errString) return self._genericMessage("Error", errString)
showObj = sickbeard.helpers.findCertainShow(sickbeard.showList, int(show)) showObj = sickbeard.helpers.findCertainShow(sickbeard.showList, int(show))
if not showObj:
if showObj is None:
errString = "Unable to find the specified show: " + str(show) errString = "Unable to find the specified show: " + str(show)
if directCall: if directCall:
return [errString] return [errString]
else: else:
return self._genericMessage("Error", errString) 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: if not location and not anyQualities and not bestQualities and not flatten_folders:
t = PageTemplate(headers=self.request.headers, file="editShow.tmpl") t = PageTemplate(headers=self.request.headers, file="editShow.tmpl")
t.submenu = HomeMenu() t.submenu = HomeMenu()
@ -3855,8 +3856,7 @@ class Home(MainHandler):
if do_update_exceptions: if do_update_exceptions:
try: try:
scene_exceptions.update_scene_exceptions(showObj.indexerid, exceptions_list) # @UndefinedVariable scene_exceptions.update_scene_exceptions(showObj.indexerid, exceptions_list) # @UndefinedVdexerid)
showObj.exceptions = scene_exceptions.get_scene_exceptions(showObj.indexerid)
time.sleep(cpu_presets[sickbeard.CPU_PRESET]) time.sleep(cpu_presets[sickbeard.CPU_PRESET])
except exceptions.CantUpdateException, e: except exceptions.CantUpdateException, e:
errors.append("Unable to force an update on scene exceptions of the show.") errors.append("Unable to force an update on scene exceptions of the show.")