XBMC Community Forum
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)



- mwkurt - 2010-10-22 20:10

Cliffe,

Your script looks like something I would like to try, however, I have 5 2TB drives that I save my TV shows to. From looking through this thread I think that I am seeing that this will only work with sorting to 1 directory. Is there any way to get this to work with more than one directory that TV Shows are stored in?

Thanks,
Mark


- lompelurt - 2010-10-22 20:15

Thanks for the noob guide Cliffe, but I get an error when i type in the perl sorttv.pl command.

DBM: Deep : Cannot sysopen file '/.tvdb' : Permission denied

Any Idea what i am doing wrong?


New version available - cliffe - 2010-10-22 23:23

Version 1.7 is here.
  • As there seems to be demand for it, there is a new feature to optionally only sort episodes that have a matching show directory in the destination directory. This makes it easy to sort from one incoming directory, out to multiple directories.

    --require-show-directories-already-exist:[TRUE|FALSE]
    [INDENT]Only sort into show directories that already exist
    This may be helpful if you have multiple destination directories. Just set up all the other details in the conf file,
    and specify the destination directory when invoking the script. Only episodes that match existing directories in the destination will be moved.
    If this is false, then new directories are created for shows that dont have a directory.
    TRUE/FALSE
    If not specified, FALSE
    [/INDENT]
  • When recursively sorting contents of directories with a non-episode directory specified, non-episode files are now named after where they were sorted from. For example
    "My Show s1e2/read this.txt"
    would be moved to
    Non-episode-directory/"My Show s1e2-read this.txt"
  • Also included are some output clean ups, and some bug fixes.

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

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

mwkurt Wrote:Is there any way to get this to work with more than one directory that TV Shows are stored in?

There is now Smile


- cliffe - 2010-10-22 23:30

lompelurt Wrote:Thanks for the noob guide Cliffe, but I get an error when i type in the perl sorttv.pl command.

DBM: Deep : Cannot sysopen file '/.tvdb' : Permission denied

Any Idea what i am doing wrong?

That is coming from within the TVDB API module. Is there any more info? Are any other Windows users seeing this error message?


- CoinTos - 2010-10-22 23:59

Hey cliffe,

Just tested your latest script and it keeps getting better and better, even sent a $10'er as a thank you.

Still have a small problem with the ep look up and I was wondering since I use the Sort To folder as a samba share if there was a way to add force windows illegal character filtering. I tried it myself with CSI: Crime Scene Investigators but it failed to look up the ep title cause I removed the : (I believe). It also failed with Shit My Father Says. So I wonder if there is a way to add tvdb id support to show name subsitution. So it can still find the ep details even if the directory you want is slightly different.

Keep up the great scripting.

Thanks again.


New version available - cliffe - 2010-10-23 07:05

Introducing v 1.8:

New feature:
--force-windows-compatible-filenames:[TRUE|FALSE]
[INDENT]Forces MSWindows compatible file names, even when run on other platforms such as Linux
This may be helpful if you are writing to a Windows share from a Linux system
If not specified, FALSE[/INDENT]

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

CoinTos Wrote:Hey cliffe,

Just tested your latest script and it keeps getting better and better, even sent a $10'er as a thank you.

Still have a small problem with the ep look up and I was wondering since I use the Sort To folder as a samba share if there was a way to add force windows illegal character filtering. I tried it myself with CSI: Crime Scene Investigators but it failed to look up the ep title cause I removed the : (I believe). It also failed with Shit My Father Says. So I wonder if there is a way to add tvdb id support to show name subsitution. So it can still find the ep details even if the directory you want is slightly different.

Keep up the great scripting.

Thanks again.

Thanks Smile
Try out this new version. The substitute name is used for thetvdb.com lookups, so this should do the trick.

For example
Code:
CSI s1e4.avi
would be looked up as
Code:
CSI: Crime Scene Investigation
and saved as:
Code:
TV/CSI- Crime Scene Investigation/Season 1/CSI- Crime Scene Investigation - S01E04 - Pledging Mr. Johnson.avi
or on Linux with --force-windows-compatible-filenames:FALSE
Code:
TV/CSI: Crime Scene Investigation/Season 1/CSI: Crime Scene Investigation - S01E04 - Pledging Mr. Johnson.avi



- Targettio - 2010-10-23 19:54

cliffe Wrote:That is coming from within the TVDB API module. Is there any more info? Are any other Windows users seeing this error message?

I am getting the same error (SortTV 1.8, Windows 7 64bit, Strawberry Perl 5.12.1.0 64bit)

I used cpan to install the required modules (which all went fine), no log file was created (despite it being set in the conf).

I checked the permissions and ensured all users have full control over the Strawberry file

I am not sure what more info I can provide.


- newphreak - 2010-10-24 04:52

Cleaning old symlinks doesnt work. it doesnt remove symlinks of things that doesnt excist in source folder. Also it would be cool if it removed the entire show/season folders if stuff were completly gone from source folder.
thx in advance.


- cliffe - 2010-10-24 12:14

newphreak Wrote:Cleaning old symlinks doesnt work. it doesnt remove symlinks of things that doesnt excist in source folder. Also it would be cool if it removed the entire show/season folders if stuff were completly gone from source folder.
thx in advance.

I am not sure what you mean.

The remove symlink feature only removes symlinks left behind by the "sort-by:MOVE-AND-LEAVE-SYMLINK-BEHIND" feature. So the idea is if you want to keep seeding, it moves the file to an organised place, and leaves behind a link so that the torrent software sees the file as being still there.

After you have finished seeding you can use the remove symlink option to remove the links so the torrent software no longer has access to the files, and to keep that directory tidy.

On the other hand, if you used PLACE-SYMLINK the files are left in the origin directory, and organised links are placed. Remove symlinks will not do anything in this situation. This is probably not what you want, unless you want a second organised copy for xbmc. If you want to delete this copy, then just delete the directory.

Does this clear up the confusion, or is there a bug I am not aware of?


New version available - cliffe - 2010-10-24 12:25

Version 1.9 is now available.

This version should hopefully fix the bug reported below. If not please let me know Smile

Also added is a feature for downloading images from thetvdb.

--fetch-images:[NEW_SHOWS|FALSE]
[INDENT]Download images for shows, seasons, and episodes from thetvdb
Downloaded images are copied into the sort-to (destination) directory.
NEW_SHOWS - When new shows, seasons, or episodes are created the associated images are downloaded
FALSE - No images are downloaded
if not specified, NEW_SHOWS[/INDENT]

--images-format:POSTER
[INDENT]Sets the image format to use, poster or banner.
POSTER/BANNER
if not specified, POSTER[/INDENT]

So far it only downloads images for new shows, seasons, and episodes. Maybe a future release will add the ability to download images for shows you already have.

Keep in mind this slows down the sort considerably, and at the moment is enabled by default. Also currently this all happens in the one thread. You may want to disable this feature in the config file.

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

Targettio Wrote:I am getting the same error (SortTV 1.8, Windows 7 64bit, Strawberry Perl 5.12.1.0 64bit)

Hopefully this update fixes the problem by storing the tv cache db with the script. I am relying on you guys to test this for me, thanks Smile