From 08c3e3ad1b8d0c8f81385d20208de330098730c4 Mon Sep 17 00:00:00 2001 From: Smenus Date: Sat, 5 Apr 2014 23:51:08 +0100 Subject: [PATCH] Another attempt at a fix for DeleteSamples and ResetDateTime. --- DeleteSamples.py | 10 +++++----- ResetDateTime.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/DeleteSamples.py b/DeleteSamples.py index d95aff58..43592ad5 100644 --- a/DeleteSamples.py +++ b/DeleteSamples.py @@ -62,13 +62,13 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5 if os.environ['NZBOP_UNPACK'] != 'yes': print "Please enable option \"Unpack\" in nzbget configuration file, exiting." - sys.exit(config.POSTPROCESS_ERROR) + sys.exit(config.NZBGET_POSTPROCESS_ERROR) # Check par status if os.environ['NZBPP_PARSTATUS'] == '3': print "Par-check successful, but Par-repair disabled, exiting." print "Please check your Par-repair settings for future downloads." - sys.exit(config.POSTPROCESS_NONE) + sys.exit(config.NZBGET_POSTPROCESS_NONE) if os.environ['NZBPP_PARSTATUS'] == '1' or os.environ['NZBPP_PARSTATUS'] == '4': print "Par-repair failed, setting status \"failed\"." @@ -99,7 +99,7 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5 # All checks done, now launching the script. if status == 1: - sys.exit(config.POSTPROCESS_NONE) + sys.exit(config.NZBGET_POSTPROCESS_NONE) mediaContainer = os.environ['NZBPO_MEDIAEXTENSIONS'].split(',') SampleIDs = os.environ['NZBPO_SAMPLEIDS'].split(',') @@ -116,8 +116,8 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5 os.unlink(filePath) except: print "Error: unable to delete file", filePath - sys.exit(config.POSTPROCESS_ERROR) - sys.exit(config.POSTPROCESS_SUCCESS) + sys.exit(config.NZBGET_POSTPROCESS_ERROR) + sys.exit(config.NZBGET_POSTPROCESS_SUCCESS) else: print "This script can only be called from NZBGet (11.0 or later)." diff --git a/ResetDateTime.py b/ResetDateTime.py index 6c7fc7a6..4965b8a9 100644 --- a/ResetDateTime.py +++ b/ResetDateTime.py @@ -29,13 +29,13 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5 if os.environ['NZBOP_UNPACK'] != 'yes': print "Please enable option \"Unpack\" in nzbget configuration file, exiting." - sys.exit(config.POSTPROCESS_ERROR) + sys.exit(config.NZBGET_POSTPROCESS_ERROR) # Check par status if os.environ['NZBPP_PARSTATUS'] == '3': print "Par-check successful, but Par-repair disabled, exiting." print "Please check your Par-repair settings for future downloads." - sys.exit(config.POSTPROCESS_NONE) + sys.exit(config.NZBGET_POSTPROCESS_NONE) if os.environ['NZBPP_PARSTATUS'] == '1' or os.environ['NZBPP_PARSTATUS'] == '4': print "Par-repair failed, setting status \"failed\"." @@ -66,7 +66,7 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5 # All checks done, now launching the script. if status == 1: - sys.exit(config.POSTPROCESS_NONE) + sys.exit(config.NZBGET_POSTPROCESS_NONE) directory = os.path.normpath(os.environ['NZBPP_DIRECTORY']) for dirpath, dirnames, filenames in os.walk(directory): @@ -78,8 +78,8 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5 continue except: print "Error: unable to reset time for file", file - sys.exit(config.POSTPROCESS_ERROR) - sys.exit(config.POSTPROCESS_SUCCESS) + sys.exit(config.NZBGET_POSTPROCESS_ERROR) + sys.exit(config.NZBGET_POSTPROCESS_SUCCESS) else: print "This script can only be called from NZBGet (11.0 or later)."