Page 1 of 1
pre-queue script input parameters
Posted: October 2nd, 2012, 12:08 pm
by squareatom
What is meant by "The sorting info is passed independent on the actual Sorting settings. Only the SeasonSort method will be used for analysis." on
http://wiki.sabnzbd.org/user-pre-queue-script?
Also, for input parameters 8-11 what are they supposed to be? They are just blank.
For example, these are values returned when NZB "Revolution.2012.S01E03.720p.HDTV.X264-DIMENSION.nzb"
Sample script:
Code: Select all
#!/bin/bash
f=~/tmp/pre-queue.out
echo " \$8: '$8'" >> $f
echo " \$9: '$9'" >> $f
echo "\$10: '${10}'" >> $f
echo "\$11: '${11}'" >> $f
Output from script:
If possible, I would like to access the Series Sorting variables in a pre-queue script and change them.
Re: pre-queue script input parameters
Posted: October 2nd, 2012, 12:51 pm
by shypike
I means that the "TV Sort" algorithm is used to determine season and episode.
8 : Show name
9 : Season (1..99)
10 : Episode (1..99)
11: Episode name
Only it isn't working due to a bug that sneaked in somewhere in the 0.7.x series.
It will be fixed in 0.7.4
Re: pre-queue script input parameters
Posted: October 2nd, 2012, 1:47 pm
by squareatom
Thanks for the quick response. I'm on 0.7.4RC2 and the fields are blank. So I guess it's not fixed yet? Is there any other way to access "TV Sorting" values?
Re: pre-queue script input parameters
Posted: October 2nd, 2012, 2:24 pm
by shypike
I said 0.7.4, not 0.7.4RC2

Will be out soon.
Re: pre-queue script input parameters
Posted: October 2nd, 2012, 3:49 pm
by squareatom
Sounds good! Is there any other way to access "TV Sorting" values in the mean time? Like calling a python sabnzbd function?
Re: pre-queue script input parameters
Posted: October 2nd, 2012, 3:55 pm
by shypike
Just wait until tomorrow

Re: pre-queue script input parameters
Posted: October 2nd, 2012, 4:03 pm
by squareatom
Oh you're quick with the replies
Sweet, didn't realize it would be so soon!
I think this is what I am looking for tho in lieu of the pre-queue.
Code: Select all
from sabnzbd.tvsort import SeriesSorter
def analyse_show(name):
""" Do a quick SeasonSort check and return basic facts """
job = SeriesSorter(name, None, None)
if job.is_match():
job.get_values()
info = job.show_info
return info.get('show_name', ''), \
info.get('season_num', ''), \
info.get('episode_num', ''), \
info.get('ep_name', '')
Re: pre-queue script input parameters
Posted: October 2nd, 2012, 4:06 pm
by shypike
That's the code from SABnzbd.
It misses one line, which will be in 0.7.4
Code: Select all
from sabnzbd.tvsort import SeriesSorter
def analyse_show(name):
""" Do a quick SeasonSort check and return basic facts """
job = SeriesSorter(name, None, None)
job.match(force=True)
if job.is_match():
job.get_values()
info = job.show_info
return info.get('show_name', ''), \
info.get('season_num', ''), \
info.get('episode_num', ''), \
info.get('ep_name', '')
Re: pre-queue script input parameters
Posted: October 2nd, 2012, 4:19 pm
by squareatom
I added the line and still no input values 8-11. Guess there is more to the bug than just that function but thanks for the info. I'll just wait for 0.7.4
Re: pre-queue script input parameters
Posted: October 2nd, 2012, 4:21 pm
by shypike
Are you using that piece of code in your own script?
It won't work, because the underlying tvsort code requires
quite a few parameters to be set up.
Re: pre-queue script input parameters
Posted: October 2nd, 2012, 4:25 pm
by squareatom
Nah I changed it in newsunpack.py. I was going to try in my own script but you just saved me to trouble.
Re: pre-queue script input parameters
Posted: October 2nd, 2012, 4:29 pm
by shypike
squareatom wrote:Nah I changed it in newsunpack.py. I was going to try in my own script but you just saved me to trouble.
You changed it in SABnzbd itself and it still doesn't work?
That would be bad news. It works for me.
BTW: the title should have the proper formatting, like "Show S01E04 name" or "Show 1x04 name".
Something like "Winter in 1995" will not give parameters.
Re: pre-queue script input parameters
Posted: October 2nd, 2012, 4:34 pm
by squareatom
Whoops. You're correct. It works. I just needed to restart Sabnzbd. Not sure why I didn't think of that before.
EDIT: So is the following still true? Or will values of output lines 8-11 be applied to TV Sorting?
Code: Select all
SABnzbd uses the first 7 lines of output, so they should only contain proper data (or be empty).
Anything after line 7 is ignored.