mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-08 11:03:38 +00:00
Fix updating of scene exception name cache after adding exceptions on Editshow page
This commit is contained in:
parent
dfa28d31fb
commit
bf510f709c
3 changed files with 9 additions and 2 deletions
|
@ -42,6 +42,7 @@
|
||||||
* Change to reduce the time taken to "Update shows" with show data
|
* Change to reduce the time taken to "Update shows" with show data
|
||||||
* Change to stop updating the IMDb info during the scheduled daily update for every show
|
* Change to stop updating the IMDb info during the scheduled daily update for every show
|
||||||
* Change to update the IMDb info for a show after snatching an episode for it
|
* Change to update the IMDb info for a show after snatching an episode for it
|
||||||
|
* Fix updating of scene exception name cache after adding exceptions on Editshow page
|
||||||
|
|
||||||
[develop changelog]
|
[develop changelog]
|
||||||
* Fix traceback error when using the menu item Manage/Update Kodi
|
* Fix traceback error when using the menu item Manage/Update Kodi
|
||||||
|
|
|
@ -84,13 +84,14 @@ def buildNameCache(show=None):
|
||||||
global nameCache
|
global nameCache
|
||||||
|
|
||||||
with nameCacheLock:
|
with nameCacheLock:
|
||||||
# clear internal name cache
|
|
||||||
clearCache()
|
|
||||||
|
|
||||||
# update scene exception names
|
# update scene exception names
|
||||||
sickbeard.scene_exceptions.retrieve_exceptions()
|
sickbeard.scene_exceptions.retrieve_exceptions()
|
||||||
|
|
||||||
if not show:
|
if not show:
|
||||||
|
# clear internal name cache
|
||||||
|
clearCache()
|
||||||
|
|
||||||
logger.log(u"Building internal name cache for all shows", logger.MESSAGE)
|
logger.log(u"Building internal name cache for all shows", logger.MESSAGE)
|
||||||
|
|
||||||
cacheDB = db.DBConnection('cache.db')
|
cacheDB = db.DBConnection('cache.db')
|
||||||
|
@ -114,6 +115,9 @@ def buildNameCache(show=None):
|
||||||
|
|
||||||
nameCache[name] = int(show.indexerid)
|
nameCache[name] = int(show.indexerid)
|
||||||
else:
|
else:
|
||||||
|
# remove old show cache entries
|
||||||
|
nameCache = dict((k, v) for k, v in nameCache.items() if v != show.indexerid)
|
||||||
|
|
||||||
logger.log(u"Building internal name cache for " + show.name, logger.MESSAGE)
|
logger.log(u"Building internal name cache for " + show.name, logger.MESSAGE)
|
||||||
|
|
||||||
for curSeason in [-1] + sickbeard.scene_exceptions.get_scene_seasons(show.indexerid):
|
for curSeason in [-1] + sickbeard.scene_exceptions.get_scene_seasons(show.indexerid):
|
||||||
|
|
|
@ -44,6 +44,7 @@ from sickbeard.scene_exceptions import get_scene_exceptions
|
||||||
from sickbeard.scene_numbering import get_scene_numbering, set_scene_numbering, get_scene_numbering_for_show, \
|
from sickbeard.scene_numbering import get_scene_numbering, set_scene_numbering, get_scene_numbering_for_show, \
|
||||||
get_xem_numbering_for_show, get_scene_absolute_numbering_for_show, get_xem_absolute_numbering_for_show, \
|
get_xem_numbering_for_show, get_scene_absolute_numbering_for_show, get_xem_absolute_numbering_for_show, \
|
||||||
get_scene_absolute_numbering
|
get_scene_absolute_numbering
|
||||||
|
from sickbeard.name_cache import buildNameCache
|
||||||
from sickbeard.browser import foldersAtPath
|
from sickbeard.browser import foldersAtPath
|
||||||
from sickbeard.blackandwhitelist import BlackAndWhiteList, short_group_names
|
from sickbeard.blackandwhitelist import BlackAndWhiteList, short_group_names
|
||||||
from tornado import gen
|
from tornado import gen
|
||||||
|
@ -1307,6 +1308,7 @@ class Home(MainHandler):
|
||||||
if do_update_exceptions:
|
if do_update_exceptions:
|
||||||
try:
|
try:
|
||||||
scene_exceptions.update_scene_exceptions(showObj.indexerid, exceptions_list) # @UndefinedVdexerid)
|
scene_exceptions.update_scene_exceptions(showObj.indexerid, exceptions_list) # @UndefinedVdexerid)
|
||||||
|
buildNameCache(showObj)
|
||||||
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.')
|
||||||
|
|
Loading…
Reference in a new issue