Scan movie db by folder name not file name? (3 Viewers)

rjburke377

Portal Member
March 24, 2008
15
0
Ottawa
Home Country
Canada Canada
Ok then :)

http://users.edpnet.be/darkie/movierenamer/MovieRenamer.bat
http://users.edpnet.be/darkie/movierenamer/MovieRenamer.jar
http://users.edpnet.be/darkie/movierenamer/MovieRenamer.java

You can use the bat file for easy reuse. Just put all the directories you want to scan and rename between double quotes and seperated by a space.

Put both files in the same directory(which one doesn't matter)

Directories where it finds a .info file, the application skips. This is because I create a new file with the original name but with a .info extention. So if there is ANY .info file in it, it'll be skipped. This can be important to know if you keep group release files with your extracted movies, since they are also named .info. If this is a problem, I can change it (or you can do it yourself, source is included).

Only thing you will need is a Java JRE 6.0 (maybe 5.0 also works, not sure under which one I compiled :))

You'll find this JRE on this page:
Java SE Downloads

And there you take: Java Runtime Environment (JRE) 6 Update 5

Little disclaimer: I'm not reponsible for any loss of data or bad renaming.
So first test it on your system since I only tested it on mine. Because I only rename files, I can't see for any reason that something goes bad ... but it can't hurt to do a quick test :)


I'm going to put a quick question here:
At first MP' found only 4 movies of the 91. Now about 70, the problem is that for the remaining 21, he finds mulitple IMDB possibilities. I've checked the option that he takes one automatically ... but still he ask's manual input? Is there a fix for this? And is there a way to schedule this as well? Or a script/tool that'll do all this for me?
It looks like MP uses a sqllite db, so I can probably write something myself, but it would be easier if it already existed :)
There is a function in IMDBFetcher.cs called RefreshIMDB() that uses the filename to build an IMDB search string. It wouldn't be too hard to change this function to parse out the directory name as search criteria instead of using the file name.

I have changed my version to look for files of the form <movie name><date><crap>. The movie name and the date are used as the search criteria and the crap after the date is ignored. The only issue now is that the MP comparison function uses fuzzy logic implemented as a Levenshtein comparison routine. It compares the IMDB title to the original filename instead of the search criteria. I'm certain this is a bug and will attempt to fix. I will change the FuzzyMatch() function to skew results towards IMDB results that match the date and then use the Levenshtein comparison to only check the title.

A funny thing with MP implementation is that it will match the IMDB "aka" title, but only record the original title. The consequence is, for example, that "The Good, The Bad, and The Ugly" is recorded in the database as "Buono, il brutto, il cattivo, Il ". This is funny.

There is also an O^2 optimization problem as the directory is being scanned for each search. This makes the scan slower as the number of files increases. I don't know much about windows programming so this may be required because of threading / context issues.
 

Glith

Portal Pro
April 19, 2006
265
28
Home Country
Sweden Sweden
BUMP! ^^
I would love to see the IMDB fetcher get information based on the foldername.
 

gxtracker

Retired Team Member
  • Premium Supporter
  • July 25, 2005
    316
    2
    Home Country
    Canada Canada
    Why shouldn't the problem exist? I don't follow. Do you mean that there are workarounds to the issues described above?

    Since movie formats (except for the MKV container) dont have any form of unified internal tagging method like MP3's do with their ID3 tags, the only current way to parse the correct movie info is to have the movie file the name of the actual content its holds.

    I have about 100 movies ripped from my collection, all named with the format "<title> <(year)>.avi". Once in MP, i just choose "scan" on the folder and it automatically parses the files and downloads all the required information. This system required only 4 or 5 movies to manually have their info changed (such as box art).

    Maybe im the one who doesnt follow... why is parsing the directory your .avi/.mpg is stored in desired, when simply renaming the file in the folder to the correct name solves the problem? It's just generating more code (bloat) for a problem that can be solved at the users level - by correctly labeling filenames. ;)
     

    stoked

    MP Donator
  • Premium Supporter
  • December 14, 2007
    297
    8
    Home Country
    Canada Canada
    Maybe im the one who doesnt follow... why is parsing the directory your .avi/.mpg is stored in desired, when simply renaming the file in the folder to the correct name solves the problem? It's just generating more code (bloat) for a problem that can be solved at the users level - by correctly labeling filenames. ;)

    Because a lot of people use folders to identify their Movie titles instead of the filenames especially newzbin/usenet users. If you have over 100 movies named by folders, going through and renaming each file within an already properly named folder is a PITA. Sure if you've already named all your rips per movie name as filename, but what if you already did it as folder name for your entire movie collection?
     

    gxtracker

    Retired Team Member
  • Premium Supporter
  • July 25, 2005
    316
    2
    Home Country
    Canada Canada
    Because a lot of people use folders to identify their Movie titles instead of the filenames especially newzbin/usenet users.

    Then don't do that, and rip your own movie collection. ;)

    Sure if you've already named all your rips per movie name as filename, but what if you already did it as folder name for your entire movie collection?

    Then you run a script such as the one darkie has so graciously provided the community and it automates the process for you. Problem solved.
     

    rjburke377

    Portal Member
    March 24, 2008
    15
    0
    Ottawa
    Home Country
    Canada Canada
    Why shouldn't the problem exist? I don't follow. Do you mean that there are workarounds to the issues described above?
    Maybe im the one who doesnt follow... why is parsing the directory your .avi/.mpg is stored in desired, when simply renaming the file in the folder to the correct name solves the problem? It's just generating more code (bloat) for a problem that can be solved at the users level - by correctly labeling filenames. ;)

    I don't do the "each movie in it's own folder" thing. That was someone else in this thread.

    Your explanation is very good and expresses the need to have the matching algorithm use the extra info in the filename to match against the source being scraped.

    The current matching algorithm includes IMDB formatting characters like "(year</sequence>), (V), (TV), (VG), (TV series)" when comparing to your filename. The filename is compared verbatim ... including the extension and stacking tags. Where the movie titiles are short compared to the extra verbiage this results in a lot of false ambiguity, or picking up the wrong entry.

    The situation gets more difficult if you have stacked files because your filename is ignored for all but the first stacked file scanned from the directory.

    My point was that you can improve the situation, a lot, by doing as you say: rename your files to better fit the implementation. Even so, the code does not provide a means to be 100% accurate even when you know exactly which IMDB entry you are trying to match.
     

    nibby

    Portal Member
    January 30, 2007
    8
    0
    Home Country
    Denmark Denmark
    Ok then :)

    http://users.edpnet.be/darkie/movierenamer/MovieRenamer.bat
    http://users.edpnet.be/darkie/movierenamer/MovieRenamer.jar
    http://users.edpnet.be/darkie/movierenamer/MovieRenamer.java

    You can use the bat file for easy reuse. Just put all the directories you want to scan and rename between double quotes and seperated by a space.

    Put both files in the same directory(which one doesn't matter)

    Directories where it finds a .info file, the application skips. This is because I create a new file with the original name but with a .info extention. So if there is ANY .info file in it, it'll be skipped. This can be important to know if you keep group release files with your extracted movies, since they are also named .info. If this is a problem, I can change it (or you can do it yourself, source is included).

    Only thing you will need is a Java JRE 6.0 (maybe 5.0 also works, not sure under which one I compiled :))

    You'll find this JRE on this page:
    Java SE Downloads

    And there you take: Java Runtime Environment (JRE) 6 Update 5

    Little disclaimer: I'm not reponsible for any loss of data or bad renaming.
    So first test it on your system since I only tested it on mine. Because I only rename files, I can't see for any reason that something goes bad ... but it can't hurt to do a quick test :)


    I'm going to put a quick question here:
    At first MP' found only 4 movies of the 91. Now about 70, the problem is that for the remaining 21, he finds mulitple IMDB possibilities. I've checked the option that he takes one automatically ... but still he ask's manual input? Is there a fix for this? And is there a way to schedule this as well? Or a script/tool that'll do all this for me?
    It looks like MP uses a sqllite db, so I can probably write something myself, but it would be easier if it already existed :)

    Could you please upload those files again? Seems like the best option as i cant find any other way to add my movies to the DB. :mad:

    Or does anyone have new suggestions?

    I just found this after hours and hours of searching...

    moving-pictures - Google Code

    It does exactly what i need. It scans a dir and finds most logical matches no matter what file name is in the subdirs.

    Then downloads info automatically. For me it got 80/80 movies right. All happened in 2-3 clicks.

    I want to donate to this, saved my day.
     

    Users who are viewing this thread

    Top Bottom