mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Merge pull request #281 from adam111316/feature/FixNameCache
Fix updating of scene exception name cache after adding exceptions on Ed...
This commit is contained in:
commit
5567a66b44
3 changed files with 9 additions and 2 deletions
|
@ -45,6 +45,7 @@
|
|||
* 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 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]
|
||||
* Fix traceback error when using the menu item Manage/Update Kodi
|
||||
|
|
|
@ -84,13 +84,14 @@ def buildNameCache(show=None):
|
|||
global nameCache
|
||||
|
||||
with nameCacheLock:
|
||||
# clear internal name cache
|
||||
clearCache()
|
||||
|
||||
# update scene exception names
|
||||
sickbeard.scene_exceptions.retrieve_exceptions()
|
||||
|
||||
if not show:
|
||||
# clear internal name cache
|
||||
clearCache()
|
||||
|
||||
logger.log(u"Building internal name cache for all shows", logger.MESSAGE)
|
||||
|
||||
cacheDB = db.DBConnection('cache.db')
|
||||
|
@ -114,6 +115,9 @@ def buildNameCache(show=None):
|
|||
|
||||
nameCache[name] = int(show.indexerid)
|
||||
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)
|
||||
|
||||
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, \
|
||||
get_xem_numbering_for_show, get_scene_absolute_numbering_for_show, get_xem_absolute_numbering_for_show, \
|
||||
get_scene_absolute_numbering
|
||||
from sickbeard.name_cache import buildNameCache
|
||||
from sickbeard.browser import foldersAtPath
|
||||
from sickbeard.blackandwhitelist import BlackAndWhiteList, short_group_names
|
||||
from tornado import gen
|
||||
|
@ -1307,6 +1308,7 @@ class Home(MainHandler):
|
|||
if do_update_exceptions:
|
||||
try:
|
||||
scene_exceptions.update_scene_exceptions(showObj.indexerid, exceptions_list) # @UndefinedVdexerid)
|
||||
buildNameCache(showObj)
|
||||
time.sleep(cpu_presets[sickbeard.CPU_PRESET])
|
||||
except exceptions.CantUpdateException, e:
|
||||
errors.append('Unable to force an update on scene exceptions of the show.')
|
||||
|
|
Loading…
Reference in a new issue