anlarke / MovieExplorer

View information about the movies stored on your computer. (Windows)
48 stars 24 forks source link

Random database update #23

Closed jsayol closed 10 years ago

jsayol commented 10 years ago

From time to time MovieExplorer decides it wants to ignore the information it has about the movies and starts detecting and scraping all the information again, as if Database.xml were no longer valid (I get no message in that regard, it's just a guess).

Some of the times this happened I tried replacing Database.xml with an older backup but when I open the program again, the same still happens.

I'm not sure If I'm explaining clearly what the problem is, feel free to ask for any more information.

Thanks!

jsayol commented 10 years ago

Oh, one more thing I tried in that situation: I manually look up the imdb id for one of the movies affected. I then check that the corresponding files are in the Cache/imdb.com folder and also make sure that the movie information inside the corresponding xml file is correct and not corrupt in any way that I can see. Then I proceed to manually enter the imdb id for that movie inside the Database.xml file. I open MovieExplorer again and the program completely ignores all the information it has and starts "detecting" the movie. Very strange.

jsayol commented 10 years ago

I'm taking a look at the condition in Database.cpp that determines if a movie should be updated (https://github.com/anlarke/MovieExplorer/blob/57d59260fa27cefe1a07f0bd5226948c4c0bb8a9/MovieExplorer/Database.cpp#L370-L377) and it seems to be wrong.

Wouldn't that consider a movie updated only in the situation where both strIMDbID AND strMovieMeterID are unknown/connError/scrapeError? It doesn't make sense, this is always marking all the movies to be updated when they already have information. The only ones that don't get updated are the ones that don't have any ID, which is the opposite of what we want. So, the true/false assignment should be the other way around.

Let me know what you think.

ryanjay0 commented 10 years ago

Getting updated could mean just getting the information out of the xml file in the cache. Look at https://github.com/anlarke/MovieExplorer/blob/57d59260fa27cefe1a07f0bd5226948c4c0bb8a9/MovieExplorer/UpdateThread.cpp#L99

I believe that condition you pointed out is there to prevent files where the ID can't be figured out either by IMDB or MovieMeter from trying to be reloaded all the time. It basically gets one chance the first time. That could be improved but if i reversed that condition it would try to re-figure out all the unknown ones each time the program regains focus.

There is also a 2 week expiration date (changeable in the options) on the movie info in the xml files.

If you find a case where its gets into here https://github.com/anlarke/MovieExplorer/blob/57d59260fa27cefe1a07f0bd5226948c4c0bb8a9/MovieExplorer/UpdateThread.cpp#L149 when it has valid info then that's a bug.

jsayol commented 10 years ago

Well, that's what happens for commenting having just read a few lines of code. Thanks for your reply :)

My "issue" was definitely related to that 2-week expiration date on movie information, I changed it and that should fix it. Why should information expire, though? It's not like it's gonna change,or not likely.

In my case, when that expiration hits, all the information and poster images disappear from the program (they're still on disk but are ignored) and they get scrapped again from scratch.

Anyway, thanks for developing this software. It's really useful to me :)

ryanjay0 commented 10 years ago

It was a good question. There's a comment in the Database.h to get rid of bUpdated eventually. Probably because its confusing. The program still may be loading info it doesn't need from files or from the web. I'll keep an eye out. Let me know if you see it again.

Glad you enjoy the program. I do too. I barely ever have to use windows explorer anymore.