added new argument for SABnzbd0.7.17+. fixes #222

This commit is contained in:
clinton-hall 2013-12-20 11:48:08 +10:30
commit 6720aa463c
8 changed files with 90 additions and 6 deletions

View file

@ -151,7 +151,7 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
# All checks done, now launching the script
Logger.info("Script triggered from NZBGet, starting autoProcessMusic...")
result = autoProcessMusic.process(os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBNAME'], status)
# SABnzbd
# SABnzbd Pre 0.7.17
elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
# SABnzbd argv:
# 1 The final directory of the job (full path)
@ -163,6 +163,19 @@ elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
# 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2
Logger.info("Script triggered from SABnzbd, starting autoProcessMusic...")
result = autoProcessMusic.process(sys.argv[1], sys.argv[2], sys.argv[7])
# SABnzbd 0.7.17+
elif len(sys.argv) == SABNZB_0717_NO_OF_ARGUMENTS:
# SABnzbd argv:
# 1 The final directory of the job (full path)
# 2 The original name of the NZB file
# 3 Clean version of the job name (no path info and ".nzb" removed)
# 4 Indexer's report number (if supported)
# 5 User-defined category
# 6 Group that the NZB was posted in e.g. alt.binaries.x
# 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2
# 8 Failue URL
Logger.info("Script triggered from SABnzbd 0.7.17+, starting autoProcessMusic...")
result = autoProcessMusic.process(sys.argv[1], sys.argv[2], sys.argv[7])
else:
Logger.warn("Invalid number of arguments received from client.")
Logger.info("Running autoProcessMusic as a manual run...")