mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-21 17:13:42 +00:00
Fix for root dir location not being saved or set correctly for shows.
Fix for mass update edits of shows, bwlist no longer gets updated during this process as its not required. You can not change your root dir even if location does not exist so long as you have create_missing_show_dirs=1 in your config set so that there be auto-created during the next post-processing of a episode.
This commit is contained in:
parent
c8d899ad66
commit
79a1b1c31e
2 changed files with 54 additions and 54 deletions
|
@ -66,7 +66,6 @@ class TVShow(object):
|
||||||
self._indexerid = int(indexerid)
|
self._indexerid = int(indexerid)
|
||||||
self._indexer = int(indexer)
|
self._indexer = int(indexer)
|
||||||
self._name = ""
|
self._name = ""
|
||||||
self._location = ""
|
|
||||||
self._imdbid = ""
|
self._imdbid = ""
|
||||||
self._network = ""
|
self._network = ""
|
||||||
self._genre = ""
|
self._genre = ""
|
||||||
|
@ -93,6 +92,7 @@ class TVShow(object):
|
||||||
|
|
||||||
self.dirty = True
|
self.dirty = True
|
||||||
|
|
||||||
|
self._location = ""
|
||||||
self.lock = threading.Lock()
|
self.lock = threading.Lock()
|
||||||
self.isDirGood = False
|
self.isDirGood = False
|
||||||
self.episodes = {}
|
self.episodes = {}
|
||||||
|
@ -103,9 +103,6 @@ class TVShow(object):
|
||||||
|
|
||||||
self.loadFromDB()
|
self.loadFromDB()
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
name = property(lambda self: self._name, dirty_setter("_name"))
|
name = property(lambda self: self._name, dirty_setter("_name"))
|
||||||
indexerid = property(lambda self: self._indexerid, dirty_setter("_indexerid"))
|
indexerid = property(lambda self: self._indexerid, dirty_setter("_indexerid"))
|
||||||
indexer = property(lambda self: self._indexer, dirty_setter("_indexer"))
|
indexer = property(lambda self: self._indexer, dirty_setter("_indexer"))
|
||||||
|
@ -172,7 +169,7 @@ class TVShow(object):
|
||||||
logger.log(u"Setter sets location to " + newLocation, logger.DEBUG)
|
logger.log(u"Setter sets location to " + newLocation, logger.DEBUG)
|
||||||
# Don't validate dir if user wants to add shows without creating a dir
|
# Don't validate dir if user wants to add shows without creating a dir
|
||||||
if sickbeard.ADD_SHOWS_WO_DIR or ek.ek(os.path.isdir, newLocation):
|
if sickbeard.ADD_SHOWS_WO_DIR or ek.ek(os.path.isdir, newLocation):
|
||||||
self._location = newLocation
|
dirty_setter("_location")(self, newLocation)
|
||||||
self._isDirGood = True
|
self._isDirGood = True
|
||||||
else:
|
else:
|
||||||
raise exceptions.NoNFOException("Invalid folder for the show!")
|
raise exceptions.NoNFOException("Invalid folder for the show!")
|
||||||
|
@ -834,7 +831,7 @@ class TVShow(object):
|
||||||
self.flatten_folders = int(sqlResults[0]["flatten_folders"])
|
self.flatten_folders = int(sqlResults[0]["flatten_folders"])
|
||||||
self.paused = int(sqlResults[0]["paused"])
|
self.paused = int(sqlResults[0]["paused"])
|
||||||
|
|
||||||
self._location = sqlResults[0]["location"]
|
self.location = sqlResults[0]["location"]
|
||||||
|
|
||||||
if not self.lang:
|
if not self.lang:
|
||||||
self.lang = sqlResults[0]["lang"]
|
self.lang = sqlResults[0]["lang"]
|
||||||
|
|
|
@ -487,7 +487,8 @@ class MainHandler(RequestHandler):
|
||||||
|
|
||||||
class PageTemplate(Template):
|
class PageTemplate(Template):
|
||||||
def __init__(self, headers, *args, **KWs):
|
def __init__(self, headers, *args, **KWs):
|
||||||
KWs['file'] = os.path.join(sickbeard.PROG_DIR, "gui/" + sickbeard.GUI_NAME + "/interfaces/default/",KWs['file'])
|
KWs['file'] = os.path.join(sickbeard.PROG_DIR, "gui/" + sickbeard.GUI_NAME + "/interfaces/default/",
|
||||||
|
KWs['file'])
|
||||||
super(PageTemplate, self).__init__(*args, **KWs)
|
super(PageTemplate, self).__init__(*args, **KWs)
|
||||||
|
|
||||||
self.sbRoot = sickbeard.WEB_ROOT
|
self.sbRoot = sickbeard.WEB_ROOT
|
||||||
|
@ -531,6 +532,7 @@ class PageTemplate(Template):
|
||||||
kwargs['cacheDirForModuleFiles'] = os.path.join(sickbeard.CACHE_DIR, 'cheetah')
|
kwargs['cacheDirForModuleFiles'] = os.path.join(sickbeard.CACHE_DIR, 'cheetah')
|
||||||
return super(PageTemplate, self).compile(*args, **kwargs)
|
return super(PageTemplate, self).compile(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class IndexerWebUI(MainHandler):
|
class IndexerWebUI(MainHandler):
|
||||||
def __init__(self, config, log=None):
|
def __init__(self, config, log=None):
|
||||||
self.config = config
|
self.config = config
|
||||||
|
@ -3643,8 +3645,6 @@ class Home(MainHandler):
|
||||||
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()
|
||||||
|
@ -3727,54 +3727,56 @@ class Home(MainHandler):
|
||||||
else:
|
else:
|
||||||
do_update_exceptions = True
|
do_update_exceptions = True
|
||||||
|
|
||||||
bwl = BlackAndWhiteList(showObj.indexerid)
|
# If directCall from mass_edit_update no scene exceptions handling
|
||||||
if whitelist:
|
if not directCall:
|
||||||
whitelist = whitelist.split(",")
|
bwl = BlackAndWhiteList(showObj.indexerid)
|
||||||
shortWhiteList = []
|
if whitelist:
|
||||||
if helpers.set_up_anidb_connection():
|
whitelist = whitelist.split(",")
|
||||||
for groupName in whitelist:
|
shortWhiteList = []
|
||||||
group = sickbeard.ADBA_CONNECTION.group(gname=groupName)
|
if helpers.set_up_anidb_connection():
|
||||||
for line in group.datalines:
|
for groupName in whitelist:
|
||||||
if line["shortname"]:
|
group = sickbeard.ADBA_CONNECTION.group(gname=groupName)
|
||||||
shortWhiteList.append(line["shortname"])
|
for line in group.datalines:
|
||||||
else:
|
if line["shortname"]:
|
||||||
if not groupName in shortWhiteList:
|
shortWhiteList.append(line["shortname"])
|
||||||
shortWhiteList.append(groupName)
|
else:
|
||||||
|
if not groupName in shortWhiteList:
|
||||||
|
shortWhiteList.append(groupName)
|
||||||
|
else:
|
||||||
|
shortWhiteList = whitelist
|
||||||
|
bwl.set_white_keywords_for("release_group", shortWhiteList)
|
||||||
else:
|
else:
|
||||||
shortWhiteList = whitelist
|
bwl.set_white_keywords_for("release_group", [])
|
||||||
bwl.set_white_keywords_for("release_group", shortWhiteList)
|
|
||||||
else:
|
|
||||||
bwl.set_white_keywords_for("release_group", [])
|
|
||||||
|
|
||||||
if blacklist:
|
if blacklist:
|
||||||
blacklist = blacklist.split(",")
|
blacklist = blacklist.split(",")
|
||||||
shortBlacklist = []
|
shortBlacklist = []
|
||||||
if helpers.set_up_anidb_connection():
|
if helpers.set_up_anidb_connection():
|
||||||
for groupName in blacklist:
|
for groupName in blacklist:
|
||||||
group = sickbeard.ADBA_CONNECTION.group(gname=groupName)
|
group = sickbeard.ADBA_CONNECTION.group(gname=groupName)
|
||||||
for line in group.datalines:
|
for line in group.datalines:
|
||||||
if line["shortname"]:
|
if line["shortname"]:
|
||||||
shortBlacklist.append(line["shortname"])
|
shortBlacklist.append(line["shortname"])
|
||||||
else:
|
else:
|
||||||
if not groupName in shortBlacklist:
|
if not groupName in shortBlacklist:
|
||||||
shortBlacklist.append(groupName)
|
shortBlacklist.append(groupName)
|
||||||
|
else:
|
||||||
|
shortBlacklist = blacklist
|
||||||
|
bwl.set_black_keywords_for("release_group", shortBlacklist)
|
||||||
else:
|
else:
|
||||||
shortBlacklist = blacklist
|
bwl.set_black_keywords_for("release_group", [])
|
||||||
bwl.set_black_keywords_for("release_group", shortBlacklist)
|
|
||||||
else:
|
|
||||||
bwl.set_black_keywords_for("release_group", [])
|
|
||||||
|
|
||||||
if whiteWords:
|
if whiteWords:
|
||||||
whiteWords = [x.strip() for x in whiteWords.split(",")]
|
whiteWords = [x.strip() for x in whiteWords.split(",")]
|
||||||
bwl.set_white_keywords_for("global", whiteWords)
|
bwl.set_white_keywords_for("global", whiteWords)
|
||||||
else:
|
else:
|
||||||
bwl.set_white_keywords_for("global", [])
|
bwl.set_white_keywords_for("global", [])
|
||||||
|
|
||||||
if blackWords:
|
if blackWords:
|
||||||
blackWords = [x.strip() for x in blackWords.split(",")]
|
blackWords = [x.strip() for x in blackWords.split(",")]
|
||||||
bwl.set_black_keywords_for("global", blackWords)
|
bwl.set_black_keywords_for("global", blackWords)
|
||||||
else:
|
else:
|
||||||
bwl.set_black_keywords_for("global", [])
|
bwl.set_black_keywords_for("global", [])
|
||||||
|
|
||||||
errors = []
|
errors = []
|
||||||
with showObj.lock:
|
with showObj.lock:
|
||||||
|
@ -3825,14 +3827,14 @@ class Home(MainHandler):
|
||||||
# if we change location clear the db of episodes, change it, write to db, and rescan
|
# if we change location clear the db of episodes, change it, write to db, and rescan
|
||||||
if os.path.normpath(showObj._location) != os.path.normpath(location):
|
if os.path.normpath(showObj._location) != os.path.normpath(location):
|
||||||
logger.log(os.path.normpath(showObj._location) + " != " + os.path.normpath(location), logger.DEBUG)
|
logger.log(os.path.normpath(showObj._location) + " != " + os.path.normpath(location), logger.DEBUG)
|
||||||
if not ek.ek(os.path.isdir, location):
|
if not ek.ek(os.path.isdir, location) and not sickbeard.CREATE_MISSING_SHOW_DIRS:
|
||||||
errors.append("New location <tt>%s</tt> does not exist" % location)
|
errors.append("New location <tt>%s</tt> does not exist" % location)
|
||||||
|
|
||||||
# don't bother if we're going to update anyway
|
# don't bother if we're going to update anyway
|
||||||
elif not do_update:
|
elif not do_update:
|
||||||
# change it
|
# change it
|
||||||
try:
|
try:
|
||||||
showObj.location = location
|
showObj._location = location
|
||||||
try:
|
try:
|
||||||
sickbeard.showQueueScheduler.action.refreshShow(showObj) # @UndefinedVariable
|
sickbeard.showQueueScheduler.action.refreshShow(showObj) # @UndefinedVariable
|
||||||
except exceptions.CantRefreshException, e:
|
except exceptions.CantRefreshException, e:
|
||||||
|
@ -3858,6 +3860,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) # @UndefinedVariable
|
||||||
|
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.")
|
||||||
|
|
Loading…
Reference in a new issue