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

Merge pull request #312 from WebSpider/dev-code_cleanup

Code cleanup
This commit is contained in:
echel0n 2014-05-03 05:24:15 -07:00
commit c29b29a7e7
5 changed files with 15 additions and 15 deletions

View File

@ -179,7 +179,7 @@ def change_VERSION_NOTIFY(version_notify):
sickbeard.VERSION_NOTIFY = version_notify sickbeard.VERSION_NOTIFY = version_notify
if version_notify == False: if not version_notify:
sickbeard.NEWEST_VERSION_STRING = None sickbeard.NEWEST_VERSION_STRING = None
if oldSetting == False and version_notify == True: if oldSetting == False and version_notify == True:

View File

@ -146,7 +146,7 @@ def snatchEpisode(result, endStatus=SNATCHED):
logger.log(u"Unknown result type, unable to download it", logger.ERROR) logger.log(u"Unknown result type, unable to download it", logger.ERROR)
dlResult = False dlResult = False
if dlResult == False: if not dlResult:
return False return False
if sickbeard.USE_FAILED_DOWNLOADS: if sickbeard.USE_FAILED_DOWNLOADS:

View File

@ -74,7 +74,7 @@ class BacklogSearcher:
else: else:
show_list = sickbeard.showList show_list = sickbeard.showList
if self.amActive == True: if self.amActive:
logger.log(u"Backlog is still running, not starting it again", logger.DEBUG) logger.log(u"Backlog is still running, not starting it again", logger.DEBUG)
return return

View File

@ -1316,14 +1316,14 @@ class TVEpisode(object):
pass pass
# if we tried loading it from NFO and didn't find the NFO, try the Indexers # if we tried loading it from NFO and didn't find the NFO, try the Indexers
if self.hasnfo == False: if not self.hasnfo:
try: try:
result = self.loadFromIndexer(season, episode, scene_season, scene_episode) result = self.loadFromIndexer(season, episode, scene_season, scene_episode)
except exceptions.EpisodeDeletedException: except exceptions.EpisodeDeletedException:
result = False result = False
# if we failed SQL *and* NFO, Indexers then fail # if we failed SQL *and* NFO, Indexers then fail
if result == False: if not result:
raise exceptions.EpisodeNotFoundException( raise exceptions.EpisodeNotFoundException(
"Couldn't find episode " + str(season) + "x" + str(episode)) "Couldn't find episode " + str(season) + "x" + str(episode))
@ -2139,17 +2139,17 @@ class TVEpisode(object):
for cur_related_file in related_files: for cur_related_file in related_files:
cur_result = helpers.rename_ep_file(cur_related_file, absolute_proper_path, cur_result = helpers.rename_ep_file(cur_related_file, absolute_proper_path,
absolute_current_path_no_ext_length) absolute_current_path_no_ext_length)
if cur_result == False: if not cur_result:
logger.log(str(self.indexerid) + u": Unable to rename file " + cur_related_file, logger.ERROR) logger.log(str(self.indexerid) + u": Unable to rename file " + cur_related_file, logger.ERROR)
for cur_related_sub in related_subs: for cur_related_sub in related_subs:
cur_result = helpers.rename_ep_file(cur_related_sub, absolute_proper_subs_path,absolute_current_path_no_ext_length) cur_result = helpers.rename_ep_file(cur_related_sub, absolute_proper_subs_path,absolute_current_path_no_ext_length)
if cur_result == False: if not cur_result:
logger.log(str(self.indexerid) + u": Unable to rename file " + cur_related_sub, logger.ERROR) logger.log(str(self.indexerid) + u": Unable to rename file " + cur_related_sub, logger.ERROR)
# save the ep # save the ep
with self.lock: with self.lock:
if result != False: if result:
self.location = absolute_proper_path + file_ext self.location = absolute_proper_path + file_ext
for relEp in self.relatedEps: for relEp in self.relatedEps:
relEp.location = absolute_proper_path + file_ext relEp.location = absolute_proper_path + file_ext

View File

@ -193,7 +193,7 @@ class Api:
else: else:
del kwargs["apikey"] del kwargs["apikey"]
if sickbeard.USE_API != True: if not sickbeard.USE_API:
msg = u"API :: " + remoteIp + " - SB API Disabled. ACCESS DENIED" msg = u"API :: " + remoteIp + " - SB API Disabled. ACCESS DENIED"
return False, msg, args, kwargs return False, msg, args, kwargs
elif apiKey == realKey: elif apiKey == realKey:
@ -1512,7 +1512,7 @@ class CMD_SickBeardPauseBacklog(ApiCall):
def run(self): def run(self):
""" pause the backlog search """ """ pause the backlog search """
if self.pause == True: if self.pause:
sickbeard.searchQueueScheduler.action.pause_backlog() #@UndefinedVariable sickbeard.searchQueueScheduler.action.pause_backlog() #@UndefinedVariable
return _responds(RESULT_SUCCESS, msg="Backlog paused") return _responds(RESULT_SUCCESS, msg="Backlog paused")
else: else:
@ -2172,7 +2172,7 @@ class CMD_ShowPause(ApiCall):
if not showObj: if not showObj:
return _responds(RESULT_FAILURE, msg="Show not found") return _responds(RESULT_FAILURE, msg="Show not found")
if self.pause == True: if self.pause:
showObj.paused = 1 showObj.paused = 1
return _responds(RESULT_SUCCESS, msg=str(showObj.name) + " has been paused") return _responds(RESULT_SUCCESS, msg=str(showObj.name) + " has been paused")
else: else: