mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
Removed duplicate code from initalizer.
Fixed up code for delete_failed in both TV and Movie autoPP scripts.
This commit is contained in:
parent
a9d3ee2a60
commit
92d00ed62a
3 changed files with 9 additions and 12 deletions
|
@ -242,10 +242,6 @@ def initialize(section=None):
|
|||
USER_DELAY = int(CFG["UserScript"]["delay"])
|
||||
USER_SCRIPT_RUNONCE = int(CFG["UserScript"]["user_script_runOnce"])
|
||||
|
||||
GIT_PATH = CFG["General"]["git_path"]
|
||||
GIT_USER = CFG["General"]["git_user"]
|
||||
GIT_BRANCH = CFG["General"]["git_branch"]
|
||||
|
||||
__INITIALIZED__ = True
|
||||
return True
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ class autoProcessMovie:
|
|||
else:
|
||||
logger.postprocess("Download of %s has failed.", nzbName)
|
||||
|
||||
if delete_failed and not os.path.dirname(dirName) == dirName:
|
||||
if delete_failed and os.path.isdir(dirName) and not os.path.dirname(dirName) == dirName:
|
||||
logger.postprocess("Deleting failed files and folder %s", dirName)
|
||||
delete(dirName)
|
||||
|
||||
|
|
|
@ -138,14 +138,15 @@ class autoProcessTV:
|
|||
|
||||
if status == 0:
|
||||
logger.postprocess("The download succeeded. Sending process request to %s", section)
|
||||
elif fork in nzbtomedia.SICKBEARD_FAILED:
|
||||
logger.postprocess("The download failed. Sending 'failed' process request to SickBeard's %s branch", fork)
|
||||
else:
|
||||
logger.postprocess("The download failed. SickBeard's %s branch does not handle failed downloads. Nothing to process", fork)
|
||||
if delete_failed and os.path.isdir(dirName) and not dirName in ['sys.argv[0]','/','']:
|
||||
logger.postprocess("Deleting directory: %s", dirName)
|
||||
delete(dirName)
|
||||
return 0 # Success (as far as this script is concerned)
|
||||
if fork in nzbtomedia.SICKBEARD_FAILED:
|
||||
logger.postprocess("The download failed. Sending 'failed' process request to SickBeard's %s branch", fork)
|
||||
else:
|
||||
logger.postprocess("The download failed. SickBeard's %s branch does not handle failed downloads. Nothing to process", fork)
|
||||
if delete_failed and os.path.isdir(dirName) and not os.path.dirname(dirName) == dirName:
|
||||
logger.postprocess("Deleting failed files and folder %s", dirName)
|
||||
delete(dirName)
|
||||
return 0 # Success (as far as this script is concerned)
|
||||
|
||||
if status == 0 and transcode == 1: # only transcode successful downlaods
|
||||
result = Transcoder().Transcode_directory(dirName)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue