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

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

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49


- cliffe - 2011-03-09

carmenm Wrote:Hi cliffe,
I have been testing your script and i must say that it works amazingly well.
I think i am gonna try and add new features to it like:

Great! I look forward to collaboration.

carmenm Wrote:- confirmation for moving files

Cool, just make sure it is optional, since most people use the script non-interactively. Also keep in mind that eventually it would be good if the script had a number of interface options (GUI/xbmc plugin), so put the interaction in a subroutine.

carmenm Wrote:- creating an "undo" script (asking for each file if you want to revert operation)

Great idea. Maybe work by reading the log file. Please add it as an argument option rather than a new script.

carmenm Wrote:- movie integration ( i ll have to look at themoviedb package).

Great! The moviedb perl module I have mentioned before only seems to be available on Linux, not Strawberry Perl, maybe start by checking if that is still the case and find out why.

carmenm Wrote:So i think you should put your project on launchpad or github so that we can work together more easily

Great work!

The main git repository is hosted on sourceforge. Just clone the repo and work from there. If you set up your own repo on github with your version I can pull from there when you are ready. If you want me to review anything you have done in the mean time just create a patch and post it here or email it to me.

I look forward to some code! Smile


- foe83 - 2011-03-09

I was thinking of writing a xbmc python script to launch the perl script directly from within xbmc. Since I'm new to python in general I was thinking of doing this in stages:
1. script with 2 options: locate sorttv directory and launch the script (might have to do different options or find a way to pick up which OS xbmc is running on).
2. add second window to set the options and save them to the sorttv config file.
3. perhaps add options to set cron runs or windoz equivalent?
What do you guys think? Should I go ahead with it? Anyone will find it useful?


- carmenm - 2011-03-09

cliffe Wrote:Great! I look forward to collaboration.



Cool, just make sure it is optional, since most people use the script non-interactively. Also keep in mind that eventually it would be good if the script had a number of interface options (GUI/xbmc plugin), so put the interaction in a subroutine.



Great idea. Maybe work by reading the log file. Please add it as an argument option rather than a new script.



Great! The moviedb perl module I have mentioned before only seems to be available on Linux, not Strawberry Perl, maybe start by checking if that is still the case and find out why.



The main git repository is hosted on sourceforge. Just clone the repo and work from there. If you set up your own repo on github with your version I can pull from there when you are ready. If you want me to review anything you have done in the mean time just create a patch and post it here or email it to me.

I look forward to some code! Smile
Yes i intend to add everything as a function and optional. By the wway you should look at GetOpt for dealing with options. It makes things a lot cleaner and easier.
I use it all the time.


- cliffe - 2011-03-09

foe83 Wrote:I was thinking of writing a xbmc python script to launch the perl script directly from within xbmc. Since I'm new to python in general I was thinking of doing this in stages:
1. script with 2 options: locate sorttv directory and launch the script (might have to do different options or find a way to pick up which OS xbmc is running on).
2. add second window to set the options and save them to the sorttv config file.
3. perhaps add options to set cron runs or windoz equivalent?
What do you guys think? Should I go ahead with it? Anyone will find it useful?

Sounds just like what I was hoping for.

I think the Perl and Python scripts could be bundled together, so that SortTV could be installed from within xbmc etc. So you can probably assume the other script is in the same directory.

The interface should be designed so that changes in the options accepted by sorttv.pl are easily detected. Maybe the easiest way to achieve that would be for sorttv.pl to provide a list of options and their accepted values, which the interface script could use to build the options interface. The output from --help would already provide most of the information required. For example, if "sorttv.pl –help" reports the option "--rename-episodes:[TRUE|FALSE]", then the interface provides a combo/spinbox with those two options, and it can be populated with the default value or the value in a config file.

If the logic is abstracted from the gui then it wouldn't be to hard to also have another version of the interface that is independent of xbmc.

I am very keen to add a friendly interface to SortTV, and would love to include the python script in the SortTV releases.


- carmenm - 2011-03-09

i am changing the script to use GetOpt. Should i commit? How do you want me to process?


- cliffe - 2011-03-09

carmenm Wrote:i am changing the script to use GetOpt. Should i commit? How do you want me to process?

I plan to use the workflow described here:
http://progit.org/book/ch5-2.html#public_small_project
http://progit.org/book/ch5-1.html#integrationmanager_workflow

Please commit each new feature to a separate branch then send me a pull request when you are ready for me to review and merge your work.

Thanks!

Edit: Alternatively feel free to use git to create patches and send them to me via email or on this forum. Also, everyone else should feel free to continue to create patches the simple way (with diff -u).


- carmenm - 2011-03-09

how do i create a new branch on sourceforge?
I have branched locally, switched to it, commited. But now i want to push it in a new branch on your repo. I dont see how to do that


- cliffe - 2011-03-09

carmenm Wrote:how do i create a new branch on sourceforge?
I have branched locally, switched to it, commited. But now i want to push it in a new branch on your repo. I dont see how to do that

You commit it to your own remote repo (for example, on github), and I'll then take a look at it, and if I don't have any change requests I will merge it into the main repo, then later you can pull the accepted changes back into yours.

http://progit.org/book/ch5-1.html#integrationmanager_workflow
Quote:1.The project maintainer pushes to their public repository.
2.A contributor clones that repository and makes changes.
3.The contributor pushes to their own public copy.
4.The contributor sends the maintainer an e-mail asking them to pull changes.
5.The maintainer adds the contributor’s repo as a remote and merges locally.
6.The maintainer pushes merged changes to the main repository.



- carmenm - 2011-03-09

ok. i thought i could create a branch on sourceforge.
will create a branch on my github


- carmenm - 2011-03-10

here is the fork i have done from your work cliffe
https://github.com/farfromrefug/sorttv

I changed the option parsing to use GetOpt::Long
and made a first draft at creating an undo script


- newphreak - 2011-03-10

http://pastebin.com/KWqrCHE1
Having trouble with cpan, I'm not too familiar with either linux or perl.
I'm trying to install this script on a debian squeeze box. What am i doing wrong? hehe

Edit: sorted this by updating cpan.
Now however, where can i find this missing file?
could not find ParserDetails.ini in /usr/local/share/perl/5.10.1/XML/SAX


- Gfei - 2011-03-11

I've searched this thread but haven't found anything that solves my problem. SortTV has been working great but just recently I've started getting the following:

Quote:SortTV
~~~~~~
18:33:4, 10-2-2011
Sorting /home/chris/qBT_dir/finished/ into /home/chris/Videos/TV/

not well-formed (invalid token) at line 1, column 0, byte 0 at /usr/lib/perl5/XML/Parser.pm line 187

Any thoughts on what is causing this to happen? I appreciate the advice.


- cliffe - 2011-03-13

Gfei Wrote:I've searched this thread but haven't found anything that solves my problem. SortTV has been working great but just recently I've started getting the following:



Any thoughts on what is causing this to happen? I appreciate the advice.

The TVDB module is the likely culprit. Try deleting the .cache directory and see if that fixes it.


- cliffe - 2011-03-13

newphreak Wrote:http://pastebin.com/KWqrCHE1
Having trouble with cpan, I'm not too familiar with either linux or perl.
I'm trying to install this script on a debian squeeze box. What am i doing wrong? hehe

Edit: sorted this by updating cpan.
Now however, where can i find this missing file?
could not find ParserDetails.ini in /usr/local/share/perl/5.10.1/XML/SAX

Glad you got it working. I notice that you were trying to install modules that SortTV doesn’t use any more (capitalize). Check the README file for an up-to-date list.


- cliffe - 2011-03-13

chortya Wrote:I'm actually running the script every hour with cron after ftp mirroring using lftp. Is there any better way to run this task as daemon?

And how do I upgrade the config without renewed manual updates? Are the new options appended to the old config?

Sounds fine.

For keeping your config across updates:
  • You can put all your changes in a secondary config, then you would only need to update the new config with one line at the end pointing to your config;
  • You can just replace the config file with your old one, but new features will just run with their default settings; or,
  • You could just use arguments to configure it when starting SortTV (for example, in your crontab).