![]() |
|
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) |
- CoinTos - 2010-10-28 06:14 Cliffe, Took some time after work to remove my Capitalization 'bug' then add a more platform independant solution and fix my $#*! lookup issue. Meet version 1.14rc, due to me working on windows for this and so I can test it there, Eclipse formated the file differently with my new code so a patch file was all but impossible. I mostly likely made it worst when I tried to fix the formating but anyhoo... New features (if accepted): > --show-title-rename - uses tvdb lookup for proper title format. (replaces Text::Capitalize) > added tvdb id support for shows that the ep lookup gets confused on, now you can use the tvdb id # for the sub name. ie. $#*! My Dad Says ep lookup now works with tvdb id. Once again, sorry about the lack of patch file, tomorrow when I am rested again I can copy additions into a basic editor that won't mess with it's formating so I can make a useable patch file. Here is my release candidate if you wish to look at it and implement. Sorttv 1.14rc - cliffe - 2010-10-28 09:15 CoinTos Wrote:Cliffe, First of all thanks for taking the time to do this. It is fantastic to get the code contribution. I look forward to incorporating these features into SortTV. A few constructive comments: Please stick to the code style and layout used. I realise that spacing is a matter of preference, but as with contributing to any open source projects, it is polite to use the established style, or discuss changes. I agree with reformatting the eval lines (and maybe some other changes), but when submitting patches please try to stick with the current coding style. It also makes it hard to review feature changes, when you have made lots of unrelated changes. Example of style (no need for blank lines in if statements these are the product of the forum): Code: if(condition1) {I can review changes to style separately, but please send your patch without style changes. Update: I notice you mention your editor made some changes, so perhaps these are all the result of your text editor ![]() Regarding the actual feature changes: Please call the argument "--fetch-show-title" or something that can not imply that it forces a file rename. Your version included this strange output: Code: DOWNLOAD: downloading images for CSI: Crime Scene InvestigationI look forward to the patch. Please create the patch using: Code: diff -u /path/to/sorttv.pl /path/to/your-new-version-of-sorttv.pl > sorttv.patch(or you can use git and pull the latest SortTV version from sourceforge) Please only include feature changes. (i.e. don't include your own config file settings changes) As you are probably aware, the command dos2unix can convert the Windows formatted file into a Linux formatted file. Anyway, thanks again, I look forward to receiving a patch. - CoinTos - 2010-10-28 14:23 Quote:Update: I notice you mention your editor made some changes, so perhaps these are all the result of your text editor That exactly what happened and I again apologize for it, I will submit a proper patch today as I am now not running off of few hours of sleep and not seeing the matrix everywhere I look. :-) Quote:Please call the argument "--fetch-show-title" or something that can not imply that it forces a file rename.Agreed, I blame lack of sleep. Quote:Your version included this strange output:Oops, will be looked at and corrected. Update -------- Here is the patch as it stands now. It contains the code changes for --fetch-show-name and the function for using tvdb id for sub name. I fixed Eclipse so that it will never (ever ever :-)) format the original code auto-magicly. I could not reproduce that log output you posted so I will sum it up as the auto formating of Eclipse which is now fixed. Patch File - cliffe - 2010-10-28 19:27 CoinTos Wrote:That exactly what happened and I again apologize for it, I will submit a proper patch today as I am now not running off of few hours of sleep and not seeing the matrix everywhere I look. :-)]Haha. Ok ![]() CoinTos Wrote:Agreed, I blame lack of sleep. Thanks for the patch. As is fairly typical for open source collaboration, I have reviewed your code and made some comments below. Please make and test the changes and send me another patch, then I will test and if all is well add to the next release. Cheers. ![]() Code: --- /home/greg/SortTV1.13/sorttv/sorttv.pl 2010-10-27 00:05:18.000000000 -0400Code: my $imagesformat = "POSTER";Code: $rename = $1;You mean "with or without". Code: + Rename show title to the name stored in thetvdb.com lookup format when moving, can be used with outCode: + my ($from, $filter) = @_;Code: + if ( $subdest =~ /^[+]?\d+$/ && !defined($filter) )I am inclined to not include this sub since it looks like it pretty much does a different one line thing for each request... Why not just put these one liners where this is being called from? Code: +sub fetchshowdetails {Code: + $return = tvdb_title($show);Code: + my @before = @_;Code: + my $name = fetchshowdetails("EPISODE", substitute_name(remdot($pureshowname), 1), $series, $episode);Also please check the spacing for the lines you have changed. They are often formatted differently. Check the spaces between () and also {} - CoinTos - 2010-10-28 22:21 Quote:As is fairly typical for open source collaboration, I have reviewed your code and made some comments below.I sure hope you do cause I am as proficient in programming as I am with flying without having wings. :-) Quote:Tabs rather than spaces pleaseD'oh though I got all them. Quote:Looks like you only use this second arg once. Instead, just add a check in here (see my next comment)You caught me I cheated, I kept running into a problem with it suppling the name not the ID on episode lookup. Quote:I am inclined to not include this sub since it looks like it pretty much does a different one line thing for each request... Why not just put these one liners where this is being called from?It's soon to be gone, I had this crazy idea for the look up with only Show Title and Ep Title known to make one big tvdb sub but it didn't work out like I hoped. Quote:Also please check the spacing for the lines you have changed. They are often formatted differently. Check the spaces between () and also {} I'll work on that. Update -------- Cliffe, This more of a take a look up date I did what you said above but I am still stuck on that used one variable. I cheated with it cause I wanted the actual name sub'ed for everything but episode lookup where I want the tvdb id to be used. I also include a sub that will take a show title and episode title and find the season number and episode number, sadly, I can't figure out how make it work in the reg detection of sort_directory. Anyways, here the patch so you can take a look if you like. patch - Malexx - 2010-10-29 00:44 having a problem again and dont know if i make a mistake or if this just isnt possible. Ok,in my Download Folder i have a file called"ABC-two.and.a.half.men.s01e01.avi" im my config i added"show-name-substitute:ABC-two.and.a.half.men-->Two and a Half Men" what i get is this here Sorting D:\Download\Series/ into Z:\/ INFO: trying to move ABC-two.and.a.half.men season 1 episode 1 INFO: found a matching show: Z:\/Two and a Half Men INFO: found a matching season: Z:\/Two and a Half Men/Season 1 INFO: Fetching episode title for ABC-two.and.a.half.men Season 1 Episode 1. WARN: Could not get episode title for ABC-two.and.a.half.men Season Episode 1. The Problem is when i download my Shows they wont be named like Two and a half Men S01e01 etc ... And if i have to touch the files before using the SortTV Script it would make it more or less useless. My Question is,am i doing something wrong here,or is the script just not mentioned for task like this? THX for any help greets ... - CoinTos - 2010-10-29 01:16 Hi Malexx, I can't test this to confirm at the moment but remove the periods. ABC-two and a half men-->Two and a Half Men That should sort it for you. - Malexx - 2010-10-29 01:49 edit - cliffe - 2010-10-29 12:04 CoinTos Wrote:Cliffe, Maybe just include a separate config option for Code: lookup-using-tvdb-id:name->TVDBIDTo look for files matching "Show - Episode Title.avi': Just before Code: } elsif(defined $nonepisodedir) {Code: } elsif(filename($file) =~ /(.*)-(.*)(?:\..*)/) {Maybe include a conf option for detecting turning this feature on and add a check that the feature is on in the above elsif condition. - Targettio - 2010-10-29 19:51 I am now using it for the first time in anger (previously I was just trying to make it move one file for testing purposes). When I have more than 1 file in the file that needs sorted (unsorted), the script will move the first one but then just freeze. I have to manually close the cmd screen and re-run the batch file. I am guessing a little bit, but I assume there is something in the loop which is messing up ![]() ![]() (there were 2 files to sort, this screen will never go away unless I clear it) |