mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 03:22:22 -05:00
Startup/Restart issues resolved.
This commit is contained in:
parent
52f65ca735
commit
172dec1017
@ -39,7 +39,7 @@ class TraktChecker():
|
|||||||
def run(self, force=False):
|
def run(self, force=False):
|
||||||
# add shows from trakt.tv watchlist
|
# add shows from trakt.tv watchlist
|
||||||
if sickbeard.TRAKT_USE_WATCHLIST:
|
if sickbeard.TRAKT_USE_WATCHLIST:
|
||||||
self.todoWanted = [] #its about to all get re-added
|
self.todoWanted = [] # its about to all get re-added
|
||||||
if len(sickbeard.ROOT_DIRS.split('|')) < 2:
|
if len(sickbeard.ROOT_DIRS.split('|')) < 2:
|
||||||
logger.log(u"No default root directory", logger.ERROR)
|
logger.log(u"No default root directory", logger.ERROR)
|
||||||
return
|
return
|
||||||
@ -78,7 +78,8 @@ class TraktChecker():
|
|||||||
|
|
||||||
if data is not None:
|
if data is not None:
|
||||||
logger.log(u"Removing " + show_obj.name + " from trakt.tv library", logger.DEBUG)
|
logger.log(u"Removing " + show_obj.name + " from trakt.tv library", logger.DEBUG)
|
||||||
TraktCall("show/unlibrary/%API%", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD, data)
|
TraktCall("show/unlibrary/%API%", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD,
|
||||||
|
data)
|
||||||
|
|
||||||
def addShowToTraktLibrary(self, show_obj):
|
def addShowToTraktLibrary(self, show_obj):
|
||||||
"""
|
"""
|
||||||
@ -88,7 +89,7 @@ class TraktChecker():
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if self.findShow(show_obj.indexerid):
|
if self.findShow(show_obj.indexerid):
|
||||||
return
|
return
|
||||||
|
|
||||||
# URL parameters
|
# URL parameters
|
||||||
data = {
|
data = {
|
||||||
@ -99,7 +100,8 @@ class TraktChecker():
|
|||||||
|
|
||||||
if data is not None:
|
if data is not None:
|
||||||
logger.log(u"Adding " + show_obj.name + " to trakt.tv library", logger.DEBUG)
|
logger.log(u"Adding " + show_obj.name + " to trakt.tv library", logger.DEBUG)
|
||||||
TraktCall("show/library/%API%", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD, data)
|
TraktCall("show/library/%API%", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD,
|
||||||
|
data)
|
||||||
|
|
||||||
def updateShows(self):
|
def updateShows(self):
|
||||||
logger.log(u"Starting trakt show watchlist check", logger.DEBUG)
|
logger.log(u"Starting trakt show watchlist check", logger.DEBUG)
|
||||||
@ -121,7 +123,7 @@ class TraktChecker():
|
|||||||
self.startBacklog(newShow)
|
self.startBacklog(newShow)
|
||||||
else:
|
else:
|
||||||
self.todoWanted.append((int(show["tvdb_id"]), 1, 1))
|
self.todoWanted.append((int(show["tvdb_id"]), 1, 1))
|
||||||
self.todoWanted.append((int(show["tvdb_id"]), -1, -1)) #used to pause new shows if the settings say to
|
self.todoWanted.append((int(show["tvdb_id"]), -1, -1)) # used to pause new shows if the settings say to
|
||||||
|
|
||||||
def updateEpisodes(self):
|
def updateEpisodes(self):
|
||||||
"""
|
"""
|
||||||
@ -152,9 +154,13 @@ class TraktChecker():
|
|||||||
|
|
||||||
logger.log(u"Adding show " + str(indexerid))
|
logger.log(u"Adding show " + str(indexerid))
|
||||||
root_dirs = sickbeard.ROOT_DIRS.split('|')
|
root_dirs = sickbeard.ROOT_DIRS.split('|')
|
||||||
if root_dirs:
|
|
||||||
location = root_dirs[int(root_dirs[0]) + 1]
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
location = root_dirs[int(root_dirs[0]) + 1]
|
||||||
|
except:
|
||||||
|
location = None
|
||||||
|
|
||||||
|
if location:
|
||||||
showPath = ek.ek(os.path.join, location, helpers.sanitizeFileName(name))
|
showPath = ek.ek(os.path.join, location, helpers.sanitizeFileName(name))
|
||||||
dir_exists = helpers.makeDir(showPath)
|
dir_exists = helpers.makeDir(showPath)
|
||||||
if not dir_exists:
|
if not dir_exists:
|
||||||
@ -165,7 +171,7 @@ class TraktChecker():
|
|||||||
|
|
||||||
sickbeard.showQueueScheduler.action.addShow(1, int(indexerid), showPath, status,
|
sickbeard.showQueueScheduler.action.addShow(1, int(indexerid), showPath, status,
|
||||||
int(sickbeard.QUALITY_DEFAULT),
|
int(sickbeard.QUALITY_DEFAULT),
|
||||||
int(sickbeard.FLATTEN_FOLDERS_DEFAULT))
|
int(sickbeard.FLATTEN_FOLDERS_DEFAULT))
|
||||||
else:
|
else:
|
||||||
logger.log(u"There was an error creating the show, no root directory setting found", logger.ERROR)
|
logger.log(u"There was an error creating the show, no root directory setting found", logger.ERROR)
|
||||||
return
|
return
|
||||||
|
@ -2830,10 +2830,13 @@ class NewHomeAddShows(MainHandler):
|
|||||||
if helpers.findCertainShow(sickbeard.showList, int(indexer_id)):
|
if helpers.findCertainShow(sickbeard.showList, int(indexer_id)):
|
||||||
return
|
return
|
||||||
|
|
||||||
root_dirs = sickbeard.ROOT_DIRS.split('|')
|
if sickbeard.ROOT_DIRS:
|
||||||
if root_dirs:
|
root_dirs = sickbeard.ROOT_DIRS.split('|')
|
||||||
location = root_dirs[int(root_dirs[0]) + 1]
|
location = root_dirs[int(root_dirs[0]) + 1]
|
||||||
|
else:
|
||||||
|
location = None
|
||||||
|
|
||||||
|
if location:
|
||||||
show_dir = ek.ek(os.path.join, location, helpers.sanitizeFileName(showName))
|
show_dir = ek.ek(os.path.join, location, helpers.sanitizeFileName(showName))
|
||||||
dir_exists = helpers.makeDir(show_dir)
|
dir_exists = helpers.makeDir(show_dir)
|
||||||
if not dir_exists:
|
if not dir_exists:
|
||||||
|
@ -55,8 +55,11 @@ class SRWebServer(threading.Thread):
|
|||||||
assert 'data_root' in self.options
|
assert 'data_root' in self.options
|
||||||
|
|
||||||
# video root
|
# video root
|
||||||
root_dirs = sickbeard.ROOT_DIRS.split('|')
|
if sickbeard.ROOT_DIRS:
|
||||||
self.video_root = root_dirs[int(root_dirs[0]) + 1] if root_dirs else None
|
root_dirs = sickbeard.ROOT_DIRS.split('|')
|
||||||
|
self.video_root = root_dirs[int(root_dirs[0]) + 1]
|
||||||
|
else:
|
||||||
|
self.video_root = None
|
||||||
|
|
||||||
# web root
|
# web root
|
||||||
self.options['web_root'] = ('/' + self.options['web_root'].lstrip('/')) if self.options[
|
self.options['web_root'] = ('/' + self.options['web_root'].lstrip('/')) if self.options[
|
||||||
|
Loading…
Reference in New Issue
Block a user