How to pass "sort string" to xbmc?

Come up with a useful post-processing script? Share it here!
Post Reply
mr.sparkle
Newbie
Newbie
Posts: 21
Joined: September 16th, 2010, 11:54 am

How to pass "sort string" to xbmc?

Post by mr.sparkle »

Hi, I just started learning about post-processing scripts and trying to make a simple xbmc onscreen notification when a download has been processed. Is it possible to pass the sort string (i.e. clean movie title) to the ExecBuiltIn Notification command?

I read http://wiki.sabnzbd.org/user-scripts and http://forums.sabnzbd.org/viewtopic.php?t=6203 but the closest I could find was a folder variable. Unfortunately, all my movies wind up in the same folder.

Running 0.5.6 in Lucid,
Thanks in advance
User avatar
sander
Release Testers
Release Testers
Posts: 9061
Joined: January 22nd, 2008, 2:22 pm

Re: How to pass "sort string" to xbmc?

Post by sander »

Wat is a sort string? Can you give an example?

And none of the first three parameters is useful for you?
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)

Have you tried them? Or can you give an example what the above looks like for a typical download?
mr.sparkle
Newbie
Newbie
Posts: 21
Joined: September 16th, 2010, 11:54 am

Re: How to pass "sort string" to xbmc?

Post by mr.sparkle »

Wat is a sort string? Can you give an example?
Something like "%title %y %ext"found here: http://wiki.sabnzbd.org/configure-sorting
The final directory of the job
No, because all the movies go to the same folder.
The original name of the NZB file
Maybe, but it could be a convoluted name that's a little tricky to scrub, no? I usually just add the nzb from nzbmatrix. I guess I could rename the nzbs properly before adding them.
Clean version of the job name
Not sure, although I think that might be where to get it from, although that's a little beyond me.
User avatar
sander
Release Testers
Release Testers
Posts: 9061
Joined: January 22nd, 2008, 2:22 pm

Re: How to pass "sort string" to xbmc?

Post by sander »

Isn't $3 useful? Or is that nonsense when you use RSS-feeds?

Anyway: time to test it: this is the postprocess-script I wrote on my system, and it gives useful info about $1 and $2 and $3:

Code: Select all

#!/bin/sh
echo $1 $2 $3 $4 $5 $6 $7 >> /home/sander/sab-logger.txt
So, if you run that, you can what $3 offers you ...
User avatar
Mar2zz
Jr. Member
Jr. Member
Posts: 85
Joined: February 4th, 2011, 8:30 am
Contact:

Re: How to pass "sort string" to xbmc?

Post by Mar2zz »

Here is a script that notifies xbmc and updates library:
http://dl.dropbox.com/u/18712538/Sabnzb ... library.sh
mr.sparkle
Newbie
Newbie
Posts: 21
Joined: September 16th, 2010, 11:54 am

Re: How to pass "sort string" to xbmc?

Post by mr.sparkle »

Thanks, guys, $3 (clean version of the job name) is still not as clean as what SABnzbd leaves my file name as, namely "%title %y %ext" from the sort string. If the sort string can't be passed to a script, is it possible to repeat (in a script) what SABnzbd does to clean the file name down to "%title %y %ext"?
User avatar
Mar2zz
Jr. Member
Jr. Member
Posts: 85
Joined: February 4th, 2011, 8:30 am
Contact:

Re: How to pass "sort string" to xbmc?

Post by Mar2zz »

Depends on when sab renames. Does it before or after postprocessing? (i don't use that option, so I don'tknow). If it does after postprocessing you could use dirname $1 or ls $1 or something to obtain info about folders or files.
Post Reply