From 0066b9f11ec2313042429587f86e0a7265bc4db2 Mon Sep 17 00:00:00 2001 From: shypike Date: Sat, 21 Dec 2013 13:54:04 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20send=208th=20parameter=20to=20u?= =?UTF-8?q?ser=20script=20when=20empty.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modify sample script to show 8th parameter. --- Sample-PostProc.cmd | 1 + Sample-PostProc.sh | 1 + sabnzbd/newsunpack.py | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Sample-PostProc.cmd b/Sample-PostProc.cmd index 77861bf..7f0e651 100644 --- a/Sample-PostProc.cmd +++ b/Sample-PostProc.cmd @@ -11,6 +11,7 @@ echo The fourth parameter (newzbin #) = %4 echo The fifth parameter (category) = %5 echo The sixth parameter (group) = %6 echo The seventh parameter (status) = %7 +echo The eigth parameter (failure_url)= %8 echo. diff --git a/Sample-PostProc.sh b/Sample-PostProc.sh index 7cc7dee..36231d8 100755 --- a/Sample-PostProc.sh +++ b/Sample-PostProc.sh @@ -11,6 +11,7 @@ echo "The fourth parameter (newzbin-id) =" "$4" echo "The fifth parameter (category) =" "$5" echo "The sixth parameter (group) =" "$6" echo "The seventh parameter (status) =" "$7" +echo "The eigth parameter (failure_url) =" "$8" echo diff --git a/sabnzbd/newsunpack.py b/sabnzbd/newsunpack.py index 3c018c0..5ca16b8 100644 --- a/sabnzbd/newsunpack.py +++ b/sabnzbd/newsunpack.py @@ -133,7 +133,10 @@ def external_processing(extern_proc, complete_dir, filename, msgid, nicename, ca """ Run a user postproc script, return console output and exit value """ command = [str(extern_proc), str(complete_dir), str(filename), - str(nicename), str(msgid), str(cat), str(group), str(status), str(failure_url)] + str(nicename), str(msgid), str(cat), str(group), str(status)] + + if failure_url: + command.extend(str(failure_url)) if extern_proc.endswith('.py') and (sabnzbd.WIN32 or not os.access(extern_proc, os.X_OK)): command.insert(0, 'python')