Hi,
I've modified the latest iMDB mass import script to do preprocessing of title names (e.g. Some.Movie.2004.DVDRip.DivX-XYZ -> Some Movie 2004) aswell as selecting the proper match via a PickTree if more than one match are found. Inside the pick tree the currently processed title is also shown for reference.
I used this today to import ~150 movies stored in release-type folders by exporting the list from a disc catalog and running the script over it.
Btw. Ant is _really_ missing some mass-file import funtion to import divx stored on DVD-R. Or did I miss this function? I'm using 3.5.0 alpha/d7.
Btw. if you wanna use the script with pre 3.5.0 make sure to change the iMDB Rating extraction back to IntToStr(Round(...)) from current FloatToStr(...).
Now I just see there is no option to attach files in this forum, is there some place to put user contributed script in case others want to benefit from them?
Just curious, the object pascal script language doesn't by change support regular expressions to to quick and dirty pattern extraction and matching, that would be really handy for this kind of tasks. All import script could be written in a fraction of time/lines of code using something as flexible as perl.
Edit:
Just found http://regexpstudio.com/, TRegExpr library. As I have never worked with delphi (only C/C++, Perl, PHP etc.), would it be possible to make use of such lib from inside the scripting engine?
Best Regards,
Atmosfear
iMDB Mass Import with title cleaning and selection
- mass import will be added, I'll try to add that in 3.5
- you can paste the script in one of your post, between [code] [/code] tags. Or put it on a webspace if you have one. Or send it to me and I will upload it to the server.
I do not know regexp very well, that's why I did not use them. There is not regexp support in Delphi or in the Pascal Script, but as you said this can be added. I knew this site, and I planned to use this in Ant Renamer. But I could add that to Ant Movie Catalog too, it may be useful in scripts for people that know how to use these expressions
- you can paste the script in one of your post, between [code] [/code] tags. Or put it on a webspace if you have one. Or send it to me and I will upload it to the server.
I do not know regexp very well, that's why I did not use them. There is not regexp support in Delphi or in the Pascal Script, but as you said this can be added. I knew this site, and I planned to use this in Ant Renamer. But I could add that to Ant Movie Catalog too, it may be useful in scripts for people that know how to use these expressions

Regular expressions are extremely powerfull and I recommend everyone to take some time to learn their semantics. Just take the example of the script I modified, there I use something like this, to remove unwanted stuff from the release/folder name:
I did something similar much more elegant in perl using regexp:
I'll post my script later, there are some cases where the imdb import fails on some fields (they aren't caused by my changes), that I want to fix first.
Code: Select all
SetArrayLength(MovieTrash, 21);
MovieTrash[0] := '.DVD';
MovieTrash[1] := '.DVD';
MovieTrash[2] := '.DIVX';
MovieTrash[3] := '.DivX';
MovieTrash[4] := '.DiVX';
MovieTrash[5] := '.FREN';
MovieTrash[6] := '.GERM';
MovieTrash[7] := '.iNT';
MovieTrash[8] := '.INT';
MovieTrash[9] := '.LiM';
MovieTrash[10] := '.LIM';
MovieTrash[11] := '.PROP';
MovieTrash[12] := '.REPACK';
MovieTrash[13] := '.SUBB';
MovieTrash[14] := '.UNSUB';
MovieTrash[15] := '.WS';
MovieTrash[16] := '.XviD';
MovieTrash[17] := '.XViD';
MovieTrash[18] := '.XVID';
MovieTrash[19] := '.AC3';
MovieTrash[20] := '.UNRAT';
// Strip non-title thrash from dirname
for Index := 0 to 20 do
begin
if Pos(MovieTrash[Index], MovieName) <> 0 then
begin
MovieName := Copy(MovieName, 0, Pos(MovieTrash[Index], MovieName));
end;
end;
MovieName := StringReplace(MovieName, '.', ' ');
Code: Select all
my ($movie) = split /\.(?:WS|AC3|TS|TC|[A-Zi]{3,})/, $file;
$movie =~ tr/\./ /;