2011-07-23, 06:51
Version 1.30 is a minor update.
New in this version:
Donations welcome
Get the new version from:
http://sourceforge.net/projects/sorttv/
Thanks! Applied to 1.30.
In the future, please consider using the following command to generate a patch, which makes it easier for me to apply your changes:
Fixed
Enjoy.
New in this version:
- White and blacklists are now directory-aware. Just include a "/" at the end to specify that the rule applies to directories.
- PLACE-HARDLINK is now a sort-by option:
--sort-by=[MOVE|COPY|MOVE-AND-LEAVE-SYMLINK-BEHIND|PLACE-SYMLINK|PLACE-HARDLINK]
Sort by moving or copying the file. If the file already exists because it was already copied it is silently skipped.
The MOVE-AND-LEAVE-SYMLINK-BEHIND option may be handy if you want to continue to seed after sorting, this leaves a symlink in place of the newly moved file.
PLACE-SYMLINK does not move the original file, but places a symlink in the sort-to directory (probably not what you want)
PLACE-HARDLINK does not move the original file, but places a hardlink in the sort-to directory. This might be helpful if you use Linux and you want a sorted and unsorted version on the same partition.
If not specified, MOVE
Donations welcome
Get the new version from:
http://sourceforge.net/projects/sorttv/
red_five Wrote:I've made a small addition to sorttv.pl that might be of interest to other Linux users; I'm not sure if it'll work properly under Windows, but it's mere existence shouldn't cause any issues.
I store my sorted TV files on the same partition as my torrent download folder, so it's convenient for me to use hard links rather than symbolic links. I added the following conditional branch to 2 places in sorttv.pl:
Code:elsif($sortby eq "PLACE-HARDLINK") {
link($file,$newpath) or out("warn", "File $file cannot be hardlinked to $newpath. : $!");
In version 1.29, add it to lines 1461 and 1462 of function sub sort_file, and again to lines 1486 and 1487 of function sub move_a_season. Insert the above code immediately after the closing brace "}" on lines 1461 and 1486.
Once added and saved, you will be able to use PLACE-HARDLINK as one of the sort-by options. Like I said, I don't know if this will work properly in Windows, because I'm not sure if Windows supports true hard links like *nix does. However, it's mere presence in the script shouldn't cause any problems for Windows. Also, only use this option if your sorted directory is on the same partition as your source directory; hard links only work on the same partition.
Thanks! Applied to 1.30.
In the future, please consider using the following command to generate a patch, which makes it easier for me to apply your changes:
Code:
diff -u old-file-or-dir new-file-or-dir > mysorttv.patch
Pablohoney Wrote:Thanks for your reply and also this awesome script! I am using the one you just upped on 7/10/11 "pyWHATauto-1.291" Maybe I am misunderstanding what treat-directories=RECURSIVELY_SORT_CONTENTS but it seems pretty straight forward that it will move (and leave a symlink behind, in my case) the files in the directory. Instead it takes a look at the directory and, i'm assuming, since it doesn't ending in *.mkv *.avi *.mp4 or *.ogm (the containers I specified in my whitelist) it skips them and spits out the NOT IN WHITELIST error.
For example if my:
directory-to-sort=/download/
and rtorrent downloads and moves to:
/download/Breaking.Bad.e04s01.720p.HDTV.DD5.1.x264/Breaking.Bad.e04s01.720p.HDTV.DD5.1.x264
it will scan /download/Breaking.Bad.e04s01.720p.HDTV.DD5.1.x264
and spit out the NOT IN WHITELIST error, never even scanning the file
/download/Breaking.Bad.e04s01.720p.HDTV.DD5.1.x264/Breaking.Bad.e04s01.720p.HDTV.DD5.1.x264
at least that is my case...
Fixed
Enjoy.