Dev branch fixes

This commit is contained in:
echel0n 2014-04-05 17:16:26 -07:00
commit 2791139c6b
5 changed files with 57 additions and 47 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
autoProcessMedia.cfg autoProcessMedia.cfg
logging.cfg
*.pyc *.pyc
*.pyo *.pyo

10
DeleteSamples.py Normal file → Executable file
View file

@ -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': if os.environ['NZBOP_UNPACK'] != 'yes':
print "Please enable option \"Unpack\" in nzbget configuration file, exiting." print "Please enable option \"Unpack\" in nzbget configuration file, exiting."
sys.exit(config().POSTPROCESS_ERROR) sys.exit(config.NZBGET_POSTPROCESS_ERROR)
# Check par status # Check par status
if os.environ['NZBPP_PARSTATUS'] == '3': if os.environ['NZBPP_PARSTATUS'] == '3':
print "Par-check successful, but Par-repair disabled, exiting." print "Par-check successful, but Par-repair disabled, exiting."
print "Please check your Par-repair settings for future downloads." 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': if os.environ['NZBPP_PARSTATUS'] == '1' or os.environ['NZBPP_PARSTATUS'] == '4':
print "Par-repair failed, setting status \"failed\"." 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. # All checks done, now launching the script.
if status == 1: if status == 1:
sys.exit(config().POSTPROCESS_NONE) sys.exit(config.NZBGET_POSTPROCESS_NONE)
mediaContainer = os.environ['NZBPO_MEDIAEXTENSIONS'].split(',') mediaContainer = os.environ['NZBPO_MEDIAEXTENSIONS'].split(',')
SampleIDs = os.environ['NZBPO_SAMPLEIDS'].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) os.unlink(filePath)
except: except:
print "Error: unable to delete file", filePath print "Error: unable to delete file", filePath
sys.exit(config().POSTPROCESS_ERROR) sys.exit(config.NZBGET_POSTPROCESS_ERROR)
sys.exit(config().POSTPROCESS_SUCCESS) sys.exit(config.NZBGET_POSTPROCESS_SUCCESS)
else: else:
print "This script can only be called from NZBGet (11.0 or later)." print "This script can only be called from NZBGet (11.0 or later)."

10
ResetDateTime.py Normal file → Executable file
View file

@ -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': if os.environ['NZBOP_UNPACK'] != 'yes':
print "Please enable option \"Unpack\" in nzbget configuration file, exiting." print "Please enable option \"Unpack\" in nzbget configuration file, exiting."
sys.exit(config().POSTPROCESS_ERROR) sys.exit(config.NZBGET_POSTPROCESS_ERROR)
# Check par status # Check par status
if os.environ['NZBPP_PARSTATUS'] == '3': if os.environ['NZBPP_PARSTATUS'] == '3':
print "Par-check successful, but Par-repair disabled, exiting." print "Par-check successful, but Par-repair disabled, exiting."
print "Please check your Par-repair settings for future downloads." 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': if os.environ['NZBPP_PARSTATUS'] == '1' or os.environ['NZBPP_PARSTATUS'] == '4':
print "Par-repair failed, setting status \"failed\"." 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. # All checks done, now launching the script.
if status == 1: if status == 1:
sys.exit(config().POSTPROCESS_NONE) sys.exit(config.NZBGET_POSTPROCESS_NONE)
directory = os.path.normpath(os.environ['NZBPP_DIRECTORY']) directory = os.path.normpath(os.environ['NZBPP_DIRECTORY'])
for dirpath, dirnames, filenames in os.walk(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 continue
except: except:
print "Error: unable to reset time for file", file print "Error: unable to reset time for file", file
sys.exit(config().POSTPROCESS_ERROR) sys.exit(config.NZBGET_POSTPROCESS_ERROR)
sys.exit(config().POSTPROCESS_SUCCESS) sys.exit(config.NZBGET_POSTPROCESS_SUCCESS)
else: else:
print "This script can only be called from NZBGet (11.0 or later)." print "This script can only be called from NZBGet (11.0 or later)."

View file

@ -79,7 +79,7 @@ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib'
# SickBeard script category. # SickBeard script category.
# #
# category that gets called for post-processing with SickBeard. # category that gets called for post-processing with SickBeard.
#config().sbCategory=tv #sbCategory=tv
# SickBeard host. # SickBeard host.
#sbhost=localhost #sbhost=localhost

View file

@ -133,62 +133,71 @@ class migratecfg:
envCatKey = 'NZBPO_CPSCATEGORY' envCatKey = 'NZBPO_CPSCATEGORY'
envKeys = ['APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT', 'DELAY', 'METHOD', 'DELETE_FAILED', 'REMOTECPS', 'WAIT_FOR', 'TIMEPERGIB'] envKeys = ['APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT', 'DELAY', 'METHOD', 'DELETE_FAILED', 'REMOTECPS', 'WAIT_FOR', 'TIMEPERGIB']
cfgKeys = ['apikey', 'host', 'port', 'ssl', 'web_root', 'delay', 'method', 'delete_failed', 'remoteCPS', 'wait_for', 'TimePerGiB'] cfgKeys = ['apikey', 'host', 'port', 'ssl', 'web_root', 'delay', 'method', 'delete_failed', 'remoteCPS', 'wait_for', 'TimePerGiB']
for index in range(len(envKeys)): if os.environ.has_key(envCatKey):
key = 'NZBPO_CPS' + envKeys[index] for index in range(len(envKeys)):
if os.environ.has_key(key): key = 'NZBPO_CPS' + envKeys[index]
option = cfgKeys[index] if os.environ.has_key(key):
value = os.environ[key] option = cfgKeys[index]
if os.environ[envCatKey] in confignew[section].sections: value = os.environ[key]
confignew[section][envCatKey][option] = value if os.environ[envCatKey] not in confignew[section].sections:
confignew[section][os.environ[envCatKey]] = {}
confignew[section][os.environ[envCatKey]][option] = value
section = "SickBeard" section = "SickBeard"
envCatKey = 'NZBPO_SBCATEGORY' envCatKey = 'NZBPO_SBCATEGORY'
envKeys = ['HOST', 'PORT', 'USERNAME', 'PASSWORD', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK', 'DELETE_FAILED', 'DELAY', 'TIMEPERGIB', 'PROCESS_METHOD'] envKeys = ['HOST', 'PORT', 'USERNAME', 'PASSWORD', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK', 'DELETE_FAILED', 'DELAY', 'TIMEPERGIB', 'PROCESS_METHOD']
cfgKeys = ['host', 'port', 'username', 'password', 'ssl', 'web_root', 'watch_dir', 'fork', 'delete_failed', 'delay', 'TimePerGiB', 'process_method'] cfgKeys = ['host', 'port', 'username', 'password', 'ssl', 'web_root', 'watch_dir', 'fork', 'delete_failed', 'delay', 'TimePerGiB', 'process_method']
for index in range(len(envKeys)): if os.environ.has_key(envCatKey):
key = 'NZBPO_SB' + envKeys[index] for index in range(len(envKeys)):
if os.environ.has_key(key): key = 'NZBPO_SB' + envKeys[index]
option = cfgKeys[index] if os.environ.has_key(key):
value = os.environ[key] option = cfgKeys[index]
if os.environ[envCatKey] in confignew[section].sections: value = os.environ[key]
confignew[section][envCatKey][option] = value if os.environ[envCatKey] not in confignew[section].sections:
confignew[section][os.environ[envCatKey]] = {}
confignew[section][os.environ[envCatKey]][option] = value
section = "HeadPhones" section = "HeadPhones"
envCatKey = 'NZBPO_HPCATEGORY' envCatKey = 'NZBPO_HPCATEGORY'
envKeys = ['APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT', 'DELAY', 'TIMEPERGIB'] envKeys = ['APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT', 'DELAY', 'TIMEPERGIB']
cfgKeys = ['apikey', 'host', 'port', 'ssl', 'web_root', 'delay', 'TimePerGiB'] cfgKeys = ['apikey', 'host', 'port', 'ssl', 'web_root', 'delay', 'TimePerGiB']
for index in range(len(envKeys)): if os.environ.has_key(envCatKey):
key = 'NZBPO_HP' + envKeys[index] for index in range(len(envKeys)):
if os.environ.has_key(key): key = 'NZBPO_HP' + envKeys[index]
option = cfgKeys[index] if os.environ.has_key(key):
value = os.environ[key] option = cfgKeys[index]
if os.environ[envCatKey] in confignew[section].sections: value = os.environ[key]
confignew[section][envCatKey][option] = value if os.environ[envCatKey] not in confignew[section].sections:
confignew[section][os.environ[envCatKey]] = {}
confignew[section][os.environ[envCatKey]][option] = value
section = "Mylar" section = "Mylar"
envCatKey = 'NZBPO_MYCATEGORY' envCatKey = 'NZBPO_MYCATEGORY'
envKeys = ['HOST', 'PORT', 'USERNAME', 'PASSWORD', 'SSL', 'WEB_ROOT'] envKeys = ['HOST', 'PORT', 'USERNAME', 'PASSWORD', 'SSL', 'WEB_ROOT']
cfgKeys = ['host', 'port', 'username', 'password', 'ssl', 'web_root'] cfgKeys = ['host', 'port', 'username', 'password', 'ssl', 'web_root']
for index in range(len(envKeys)): if os.environ.has_key(envCatKey):
key = 'NZBPO_MY' + envKeys[index] for index in range(len(envKeys)):
if os.environ.has_key(key): key = 'NZBPO_MY' + envKeys[index]
option = cfgKeys[index] if os.environ.has_key(key):
value = os.environ[key] option = cfgKeys[index]
if os.environ[envCatKey] in confignew[section].sections: value = os.environ[key]
confignew[section][envCatKey][option] = value if os.environ[envCatKey] not in confignew[section].sections:
confignew[section][os.environ[envCatKey]] = {}
confignew[section][os.environ[envCatKey]][option] = value
section = "Gamez" section = "Gamez"
envCatKey = 'NZBPO_GZCATEGORY' envCatKey = 'NZBPO_GZCATEGORY'
envKeys = ['APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT'] envKeys = ['APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT']
cfgKeys = ['apikey', 'host', 'port', 'ssl', 'web_root'] cfgKeys = ['apikey', 'host', 'port', 'ssl', 'web_root']
for index in range(len(envKeys)): if os.environ.has_key(envCatKey):
key = 'NZBPO_GZ' + envKeys[index] for index in range(len(envKeys)):
if os.environ.has_key(key): key = 'NZBPO_GZ' + envKeys[index]
option = cfgKeys[index] if os.environ.has_key(key):
value = os.environ[key] option = cfgKeys[index]
if os.environ[envCatKey] in confignew[section].sections: value = os.environ[key]
confignew[section][envCatKey][option] = value if os.environ[envCatKey] not in confignew[section].sections:
confignew[section][os.environ[envCatKey]] = {}
confignew[section][os.environ[envCatKey]][option] = value
section = "Extensions" section = "Extensions"
envKeys = ['COMPRESSEDEXTENSIONS', 'MEDIAEXTENSIONS', 'METAEXTENSIONS'] envKeys = ['COMPRESSEDEXTENSIONS', 'MEDIAEXTENSIONS', 'METAEXTENSIONS']