XBMC Community Forum
SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for XBMC (/forumdisplay.php?fid=116)
+--- Thread: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) (/showthread.php?tid=75949)



- cliffe - 2010-10-29 21:12

Targettio Wrote:I am now using it for the first time in anger (previously I was just trying to make it move one file for testing purposes).

When I have more than 1 file in the file that needs sorted (unsorted), the script will move the first one but then just freeze. I have to manually close the cmd screen and re-run the batch file.

I am guessing a little bit, but I assume there is something in the loop which is messing upConfused

[Image: frozensorttv.png]
(there were 2 files to sort, this screen will never go away unless I clear it)

Try turning off xbmc notifications:
Code:
perl sorttv.pl --xbmc-web-server:
If you don't have it set to your own xbmc webserver, it tries to connect to the server in the config file. On Windows Perl seems to wait a long time for a response. It will be disabled by default in a later release.

Let me know if that helps.


- Malexx - 2010-10-29 21:42

CoinTos Wrote:Hi Malexx,

I can't test this to confirm at the moment but remove the periods.
ABC-two and a half men-->Two and a Half Men

That should sort it for you.

This didnt work too,it just wont copy or move if the filename doenst have the exact showname.


- cliffe - 2010-10-29 22:42

Malexx Wrote:This didnt work too,it just wont copy or move if the filename doenst have the exact showname.

The last release fixed some problems with substitutions. However, that version is limited to Linux. Hopefully the next release will fix those issues you encountered and work on Windows.


- Targettio - 2010-10-30 00:18

cliffe Wrote:Try turning off xbmc notifications:
Code:
perl sorttv.pl --xbmc-web-server:
If you don't have it set to your own xbmc webserver, it tries to connect to the server in the config file. On Windows Perl seems to wait a long time for a response. It will be disabled by default in a later release.

Let me know if that helps.

That sorts it! Thanks soo much. Big GrinLaughBig Grin


- Capt.Insano - 2010-10-30 01:05

Wow, I'm away for a week and HUGE changes happen to the Script!! Great work Cliffe, loving some of the updates, especially the Automatic Image Grabbing.

I have a question though;

When the xbmc-web-server argument is set up, should my password be part of the variable?

my sorttv.conf contains;
Code:
xbmc-web-server:localhost:8080

and I see nothing happening to XBMC when the script runs. I have also tried SortTV with:
Code:
xbmc-web-server:user:pass@localhost:8080
and still not a thing being seen happening on xbmc.

Both the script and XBMC are running on the same Ubuntu machine and the Script does not show any errors or record errors to the SortTV.log. Also my web-server is definitely running on port 8080, I am running the AWX interface and able to use it on my Laptop.

Am I missing something?
Thanks,
The Capt.


- newphreak - 2010-10-30 02:47

yeah, i havent gotten that to work either just yet Smile nor locally or from a different box on the network.


- cliffe - 2010-10-30 17:12

Capt.Insano Wrote:Wow, I'm away for a week and HUGE changes happen to the Script!! Great work Cliffe, loving some of the updates, especially the Automatic Image Grabbing.

I have a question though;

When the xbmc-web-server argument is set up, should my password be part of the variable?

my sorttv.conf contains;
Code:
xbmc-web-server:localhost:8080

and I see nothing happening to XBMC when the script runs. I have also tried SortTV with:
Code:
xbmc-web-server:user:pass@localhost:8080
and still not a thing being seen happening on xbmc.

Both the script and XBMC are running on the same Ubuntu machine and the Script does not show any errors or record errors to the SortTV.log. Also my web-server is definitely running on port 8080, I am running the AWX interface and able to use it on my Laptop.

Am I missing something?
Thanks,
The Capt.

Make sure you have "allow control of xbmc via HTTP" turned on in xbmc's settings. Test that the network is setup correctly, by opening a web browser (on the system running SortTV) and open this url:
Code:
http://localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn%28Notification%28test,test,%207000%29%29
Where localhost:8080 is however it is setup in xbmc.

You should see a webpage with the message "Ok". And a test message should display in xbmc. If not, check your xbmc and firewall settings.

If you have set a password then include it in the sorttv.conf (as you describe) eg:
Code:
xbmc-web-server:user:pass@localhost:8080

You can also include this in the test url:
Code:
http://user:pass@localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn%28Notification%28test,test,%207000%29%29



- CoinTos - 2010-10-30 17:52

Hey cliffe,

I am having a hard time with the test string.

Two and a Half Men - Give Me Your Thumb.ts

Using fixtitle() it strips all the space which I don't want.

Using just pureshowtitle it has Two and a Half Men<space>

Using google to search for remove all tailing spaces, I now have a headache. :-)
I can't get a single regex I try to work. Any ideas?


- cliffe - 2010-10-30 18:18

CoinTos Wrote:Hey cliffe,

I am having a hard time with the test string.

Two and a Half Men - Give Me Your Thumb.ts

Using fixtitle() it strips all the space which I don't want.

Using just pureshowtitle it has Two and a Half Men<space>

Using google to search for remove all tailing spaces, I now have a headache. :-)
I can't get a single regex I try to work. Any ideas?

Please just use fixtitle() on both of the strings you are comparing. Then do a simple match:

Code:
if($s1 =~ /$s2/i) {

}

That way "Two.and.a.halfmen" (or any other likely version) would match "Two and a Half Men", also it won't be fussy about the way the episode title is written.

Update: by the way there is an example of removing trailing whitespace in remdot()
Code:
$title =~ s/\s$//ig;
(Substitute space at the end "s/\s$" with blank "//" until all gone "g")


- Capt.Insano - 2010-10-30 20:10

cliffe Wrote:You can also include this in the test url:
Code:
http://user:pass@localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn%28Notification%28test,test,%207000%29%29

XBMC has "allow control of xbmc via HTTP" enabled and when I use the above URL on another computer on the same network (changing user and pass, and localhost to correct IP address) I get the Correct "Test Test" Pop Up. But SortTV still does not start XBMC Library Update.

SortTV has the correct info:
Code:
xbmc-web-server:user:pass@localhost:8080

I could not open a browser and run above URL on the same machine as XBMC as I use a Minimal XBMC Set-Up and have no Browser on the box.

Any further advice?

Thanks
The Capt.

EDIT:
Found out I could use PHP to request a URL through the commandline so I used
Code:
php -r "file('http://[i]USER:PASS[/i]@localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn%28Notification%28test,test,%207000%29%29');"

and I got the required test test PopUp, So I know that xbmc is set up correctly and there is no reason why a localhost request to port 8080 should not work, yet XBMC still will not update on using SortTV.