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: 178
Joined: Jun 2010
Reputation: 7
Big Grin    Post: #31
jjrroberts Wrote:$5 sent, love both the tool and speed of updates/enhancements!

Donation link is here to save others some time, I looked at your home page for the link when i should have gone to sf.net

Edit - And i see you are a fellow aussie, that makes me even more pleased!

Thanks! I really appreciate it!

It is great to support free open source software, it gives developers warm fuzzy feelings Smile

Thanks again!

Cliffe.
find quote
schmoko Offline
Junior Member
Posts: 47
Joined: Jul 2008
Reputation: 0
Post: #32
Capt.Insano Wrote:Is it possible to have an option that the Script copies the TV Episodes into the correct folders rather than move them?

My Setup:
rtorrent and rutorrent downloads all my shows through RSS to a folder
Code:
/mnt/DATA/Torrents/Complete/TV

I would like to copy these shows to another location:
Code:
/media/FREECOM/TV Shows/[i][b]Show Name/Season #/Episode Name[/b][/i]

Copy is important so that I can finish seeding the shows.

Would the fact that the script would need to remember what shows it has copied and not copy them again make it too difficult to achieve?

Congrats on the Script either way!!
The Capt

I'm using rtorrent too. I updated the script with the following changes:

- If a file in the current directory is a symlink ignore it
- After moving a directory or file, symlink the new location to the current folder

rtorrent is not interrupted in the brief time it takes to move and create the symlink, and you do not have to store two copies of each episode or clean an incoming directory constantly.
find quote
cliffe Offline
Senior Member
Posts: 178
Joined: Jun 2010
Reputation: 7
Thumbs Up    Post: #33
schmoko Wrote:I'm using rtorrent too. I updated the script with the following changes:

- If a file in the current directory is a symlink ignore it
- After moving a directory or file, symlink the new location to the current folder

rtorrent is not interrupted in the brief time it takes to move and create the symlink, and you do not have to store two copies of each episode or clean an incoming directory constantly.

Sounds good. Could you please send me a patch to z.cliffe {-at-} schreuders.org.

To create a patch file:
Code:
diff -u sorttv.pl your-new-version-of-sorttv.pl > sorttv.patch
(or you can use git and pull the latest SortTV version from sourceforge)

If you send me the patch I'll add it as a configurable option. Maybe an option to remove symlinks would also come in handy (could be scheduled for once a week, or so).
find quote
newphreak Offline
Member+
Posts: 176
Joined: Oct 2010
Reputation: 0
Location: sofa @ Norway
Post: #34
i would like to see an option to symlink instead of move/copy, so i wont have to ln -f -s /source/bla/bla /target/bla. can you do that? Smile

edit: all parts under COPY to do symlinks instead, but for a feature release i'd love to see move/copy/symlink option. and maybe something that deletes old dead symlinks hehe.
(This post was last modified: 2010-10-17 03:59 by newphreak.)
find quote
cliffe Offline
Senior Member
Posts: 178
Joined: Jun 2010
Reputation: 7
Smile  New version available Post: #35
A new version of SortTV is now available.

New features:
  • --sort-by:MOVE-AND-LEAVE-SYMLINK-BEHIND
    This option moves the file or directory, then leaves behind a symlink to the newly moved file. This may be handy if you want to continue to seed after sorting.
  • --sort-by:PLACE-SYMLINK
    This does not move the original file, but places a symlink in the sort-to directory. This is probably not what you want, unless you want to keep all your episodes in an unsorted directory and have sorted links to those files. This could be handy if you don't want to change the way your files are organised, but want to have a file organisation compatible with programs such as xbmc.
  • --remove-symlinks:[TRUE|FALSE]
    Deletes symlinks from the directory to sort while sorting. This may be helpful if you want to remove all the symlinks you previously left behind using --sort-by:MOVE-AND-LEAVE-SYMLINK-BEHIND
    You could schedule "perl sorttv.pl --remove-symlinks:TRUE" to remove these once a week/month.
    If this option is enabled and used at the same time as --sort-by:MOVE-AND-LEAVE-SYMLINK-BEHIND, then only the previous links will be removed, and new ones may also be created

Thanks to schmoko for the patch that I incorporated into these features.

I have noticed that a lot of people are not downloading the sample config file. I highly recommend you download the sample and edit it. It is a much simpler way of configuring the script, rather than having to supply the options via the command line arguments.

You can get the new version (and a sample config file) from:
https://sourceforge.net/projects/sorttv/files/

If you find this script helpful then please consider making a $5 paypal donation
http://sourceforge.net/donate/index.php?group_id=330009

newphreak Wrote:i would like to see an option to symlink instead of move/copy, so i wont have to ln -f -s /source/bla/bla /target/bla. can you do that? Smile

edit: all parts under COPY to do symlinks instead, but for a feature release i'd love to see move/copy/symlink option. and maybe something that deletes old dead symlinks hehe.

Check out the new version! Smile

--

These features have been tested on Linux, but should also work with newer versions of Windows (since Vista Windows has supported symbolic links).
(This post was last modified: 2010-10-17 09:54 by cliffe.)
find quote
salithus Offline
Junior Member
Posts: 7
Joined: Sep 2010
Reputation: 0
Post: #36
cliffe Wrote:I have noticed that a lot of people are not downloading the sample config file. I highly recommend you download the sample and edit it. It is a much simpler way of configuring the script, rather than having to supply the options via the command line arguments.

Maybe package them together in a .zip/.tar? The "Download Now!" button only gives you the .pl file, which is probably why no one grabs the config.
find quote
salithus Offline
Junior Member
Posts: 7
Joined: Sep 2010
Reputation: 0
Post: #37
Also, ran into an issue with the latest (may happen with earlier versions, I haven't been keeping mine up to date) where "House" episodes get matched to "Dollhouse". To fix it, I changed:

if(fixtitle($show) =~ /$showname/i || fixtitle2($show) =~ /$simpleshowname/i) {

to

if(fixtitle($show) =~ /^$showname/i || fixtitle2($show) =~ /^$simpleshowname/i) {
find quote
cliffe Offline
Senior Member
Posts: 178
Joined: Jun 2010
Reputation: 7
Post: #38
salithus Wrote:Maybe package them together in a .zip/.tar? The "Download Now!" button only gives you the .pl file, which is probably why no one grabs the config.

Ok, now distributed in a .zip, which includes the sorttv.conf

So now it is important to edit that file to the settings you want. Any settings in the conf file can be overwritten by command line arguments.

If you have edited the conf file then doing a sort is as simple as:
Code:
perl sorttv.pl
find quote
cliffe Offline
Senior Member
Posts: 178
Joined: Jun 2010
Reputation: 7
Thumbs Up    Post: #39
salithus Wrote:Also, ran into an issue with the latest (may happen with earlier versions, I haven't been keeping mine up to date) where "House" episodes get matched to "Dollhouse". To fix it, I changed:

if(fixtitle($show) =~ /$showname/i || fixtitle2($show) =~ /$simpleshowname/i) {

to

if(fixtitle($show) =~ /^$showname/i || fixtitle2($show) =~ /^$simpleshowname/i) {

Ok, thanks. Fixed in the latest version, which I have audaciously labelled version 1.0.
find quote
Capt.Insano Offline
Member
Posts: 78
Joined: Mar 2010
Reputation: 0
Location: Dublin, Ireland
Post: #40
Although I made a feature request a few posts back, which was implemented crazily fast (Copy rather than Move), Thank You Cliffe and then even improved upon with Symlink functionality, Thank You Schmoko ; I still haven't started using this great script because no of Episode Naming.

I found a utility called tvnamer with names the episodes from tvdb but doesn't support moving/copying files as well as SortTV. (It supports move, but not copy and no Symlinks)

tvnamer can be found here

http://github.com/dbr/tvnamer

Is there anyway that the tvdb_api can be accessed and used by the SortTV Script to correctly name episodes while sorting them? Or is that beyond the Scope of this Script?

The Capt.

P.S.: I am asking this question, already thinking that SortTV is a fantastic Script and with Thanks to the developer!! Not trying to diss this Script at all!!
find quote
Post Reply