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 - 2011-02-28 16:46
spyvingen Wrote:Hi i would love for this app to be an exe that has built in timer and a gui for settings is that totally out of the question?
I don't mind incorporating GUI features to make the tool easier to use. A GUI probably wouldn't need a timer, it could use the scheduling tools in Linux and Windows. It's just a matter of finding the time.
I doubt the GUI would be an .exe, but it could be an argument to the script, and a .cmd/.sh could be included for easy access to the GUI.
Anyway, it could just be a matter of including specially formatted lines in the config file that could tell the GUI about the arguments to ask the user for.
Please step forward if this sounds like a fun challenge to code.
- cliffe - 2011-02-28 16:48
fergulator Wrote:Hey Cliffe - Thanks. I love sorttv. Exactly what I was looking for. So, I was getting the same mysterious TVDB API error. Found out that it related to the source folder name I was using (was 'unsorted media') on Windows. When calling the pl, I surrounded the path with quotes; it executed fine, but I got the TVDB error. Changing the directory names to non-spaced fixed it for me.
Interesting, what happens if you run the script as administrator? (Since that was mentioned as also being a fix to the problem.) Thanks for sharing. It would be helpful if you could figure out which line in the script was throwing the error.
- cliffe - 2011-02-28 16:52
carmenm Wrote:If i am correct looking at this script description, it does the same thing as therenamer on windows?
SortTV has lots more features, and is designed to do automatic sorting. That program is mostly for renaming files without moving them (which SortTV can also do).
Yes, I would like to include movie sorting (although I won't actually use that feature). In a previous post I mentioned that a Perl module is available for querying themoviedb, but that for some reason it wasn't available from Strawberry Perl's CPAN. If someone looks into this we can add the feature.
- cliffe - 2011-02-28 16:55
sh0stak Wrote:I have tried searching this thread with no luck. I just wanted to see if anyone has setup a way to sort by MOVE if you extracted a file, otherwise sort by COPY.
Not currently. The feature to extract was added recently and just extracts into the same directory so that the files are then sorted along with everything else. The easiest solution would probably be to create a new subdirectory for the extraction, then make sure its empty after the sort. Please feel free to implement that.
- cliffe - 2011-02-28 17:01
Justcop Wrote:Obviously this is a long thread and I haven't had chance to read through all of it but I just thought I'd add an idea.
Yes, as mentioned previously movie sorting will hopefully eventually be added to the script. One way to make that happen is implement it
1. That could cause problems. In your downloading program set a different directory for completed downloads, and use that as your directory to sort.
2. Good question. Probably in most cases it would be ok, although maybe not always. With the default settings if the file is being moved, then a second attempt will skip because the destination file will exist. However, if compressed files are being extracted they could be moved before extraction finishes.
New version available - cliffe - 2011-02-28 18:00
Thanks to gardz and Patrick Cole for the code contributions.
You can get the new version here:
Gardz, I made some changes, please compare what I have released to the version you posted. Cheers
- Justcop - 2011-02-28 19:28
Would you consider adding a lock function to the script so that if you try to run it whilst it is running then it will just exit.
obviously you need to take into account deleting the lock file if the process is stopped in the middle.
With a lock option implemented the script could be set to run every few minutes and get things into the XBMC library as quickly as possible.
- newphreak - 2011-02-28 23:07
New version available - cliffe - 2011-03-01 14:22
Corrects the default setting for age of files to sort.
Get the new version here:
- cliffe - 2011-03-01 14:27
Justcop Wrote:Would you consider adding a lock function to the script so that if you try to run it whilst it is running then it will just exit.
Yeah, that is possible. I would rather add a poll feature though. That could do a sort every X minutes. In that case the script could be started in poll mode on startup, running as a daemon, rather than as a scheduled process.
Edit: No reason the script can't do both locking and polling.
I went ahead and added locking, it does it by locking the actual script file itself. This ensures only one instance of the script runs at a time. This feature is not yet tested on Windows.
Get the new version here: