Page 1 of 1

Pre-Queue Script

Posted: December 6th, 2012, 2:27 pm
by Marble68
I wasn't 100% sure where to put this, but since it lives with post-processing....

I threw together a pre-queue script that will refuse (return 0) for duplicate episodes. (I just thew it together in VBScript for SABNZBD running on windows).

It works the first time it runs, but subsequently refuses everything. No matter what, the log says the pre-queue script has refused the file, even if when I manually run it it doesn't.

I examine the logs and if I run the script passing the parameters from the Pre-Queue call - the script works as expected.

It's really simple - if the name of the file is: "Robot Chicken S06E09 1080p WEB DL AAC2 0 H264 iT00NZ" the script will find the folder called "Robot Chicken" and then the Season folder (6) and then look for Episode 9.

My sorting is: Show Name\Season 1\Show Name - S01E05 - Episode Name [DTS].avi

So basically - under the Show Name folder - I can parse all sub files for "S06E09" and return 0 or 1.

Am I missing a step? Not terminating my script correctly?

Any suggestions are appreciated.

Re: Pre-Queue Script

Posted: December 6th, 2012, 2:41 pm
by shypike
The script should have an exit value of 0
and return "1" or "0" on stdout.

Re: Pre-Queue Script

Posted: December 6th, 2012, 4:22 pm
by Marble68
Exactly how I understand it. The script is ending gracefully.
I started piping what SABNZBD is passing to the script into a file - everything looks normal.
I will pipe the returned result, too, and see if it matches. (Dunno why I didn't think of that until now.. duh!)

Re: Pre-Queue Script

Posted: January 27th, 2013, 9:08 am
by th3joker
A shell script for linux that does that would be super cool :-)