SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac)

  Thread Rating:
  • 6 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
cliffe Offline
Senior Member
Posts: 179
Joined: Jun 2010
Reputation: 7
Post: #251
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?

One more thing that would be awsom is to intergrate scru function in it.

Then this app would be the only program u need for torrent exept the torrent program itself.

Sorry for my bad english Smile

//jonas

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.
find quote
cliffe Offline
Senior Member
Posts: 179
Joined: Jun 2010
Reputation: 7
Post: #252
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.
find quote
cliffe Offline
Senior Member
Posts: 179
Joined: Jun 2010
Reputation: 7
Post: #253
carmenm Wrote:If i am correct looking at this script description, it does the same thing as therenamer on windows?
If so it s something we really missed on windows!

Any chance of a movie version? or even both at the same time....

Thanks

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.
find quote
cliffe Offline
Senior Member
Posts: 179
Joined: Jun 2010
Reputation: 7
Post: #254
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.

Some of my torrents come as archives, some just a plain file. Either way I want to continue seeding them. If it is a plain file, sort by copy works great. If it is an archive, it leaves the extracted file in the original location so now I have the seeding archive, the extracted file in the "sort-from" dir, and the extracted file in the "sort-to" dir.

I will look into making this change on my own when I have some time. I thought in the meantime I would check and see if this has already been covered though.

thanks

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.
find quote
cliffe Offline
Senior Member
Posts: 179
Joined: Jun 2010
Reputation: 7
Post: #255
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.

Certainly the way I'd like to use it most of the fiels that aren't TV shows would be movies.

Could there be a way that it checks themoviedb to see if there is a title match and then moves it into a different folder for movies.

That way after the files have been processed everything that is TV goes to one place, movies to another. What is left can be moved to the unsorted folder but hopefully this won't be much at all and can be managed manually.

Two quick questions on how the script works that may have been answered somewhere above.

1. How does the script cope with episodes that are still in the process of being downloaded but appear correctly named?

2. How would the script function if I set it to run very often so that a second copy may start running before the first has finished?

Yes, as mentioned previously movie sorting will hopefully eventually be added to the script. One way to make that happen is implement it Smile

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.
(This post was last modified: 2011-02-28 17:06 by cliffe.)
find quote
cliffe Offline
Senior Member
Posts: 179
Joined: Jun 2010
Reputation: 7
Smile  New version available Post: #256
v1.22

New features:
  • --filesize-range:rangepattern
    [INDENT]Only copy files that fall within these filesize ranges.
    Examples for the pattern include 345MB-355MB or 1.05GB-1.15GB
    [/INDENT]
  • --sort-only-older-than-days:number
    [INDENT]Sort only files or directories that are older than this number of days.
    If not specified or zero, sorts everything.[/INDENT]

Thanks to gardz and Patrick Cole for the code contributions.

You can get the new version here:
https://sourceforge.net/projects/sorttv/

Enjoy.

Gardz, I made some changes, please compare what I have released to the version you posted. Cheers Smile
find quote
Justcop Offline
Senior Member
Posts: 226
Joined: Mar 2009
Reputation: 0
Post: #257
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.

eg http://linux.byexamples.com/archives/494...e-locking/

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.
(This post was last modified: 2011-02-28 19:30 by Justcop.)
find quote
newphreak Offline
Member+
Posts: 176
Joined: Oct 2010
Reputation: 0
Location: sofa @ Norway
Post: #258
cliffe:
Spartacus.Gods.of.the.Arena.Part06.720p.HDTV.x264-IMMERSE
Spartacus.Gods.of.the.Arena.Pt.I.720p.HDTV.X264-DIMENSION
Spartacus.Gods.of.the.Arena.Pt.II.720p.HDTV.X264-CTU

Samsung ES7005 55" led tv - Denon AVR-3313 - NAD C275BEE - B&W DM683 - B&W HTM61 - B&W 686
Asus EB1501P ION2 - OCZ Vertex 2 64gb ssd - Built in IR Receiver
And a Logitech Harmony Touch to control it all. http://www.OpenELEC.tv
find quote
cliffe Offline
Senior Member
Posts: 179
Joined: Jun 2010
Reputation: 7
Smile  New version available Post: #259
v1.23

Corrects the default setting for age of files to sort.

Get the new version here:
https://sourceforge.net/projects/sorttv/
find quote
cliffe Offline
Senior Member
Posts: 179
Joined: Jun 2010
Reputation: 7
Post: #260
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.

eg http://linux.byexamples.com/archives/494...e-locking/

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.

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.
v1.24

Get the new version here:
https://sourceforge.net/projects/sorttv/
(This post was last modified: 2011-03-01 15:16 by cliffe.)
find quote
Post Reply