- June 25, 2015
- 584
- 292
- Home Country
- United Kingdom
- Thread starter
- #211
You seem to be under the impression that I am changing functionality. That is not the case. I am pointing out where there is functionality that doesn't do what it says on the tin and suggesting that we remove the redundant stuff - there's so much stuff going on that we need to get rid of the clutter when it serves no purpose. I have also, on occasion, questioned whether the original purpose is really valid or necessary.But as @ajs has said, we must not remove function merely because we personally do not see the value of it.
I've been taking an even closer look at scanning. This is what is does at the moment. When there is no information about a movie in the database when you do a scan, the configuration app searches the internet for data based on which scripts you choose to use. You are shown a list of possible titles to choose from. You choose the title you want information for and the system goes and gets that information, loading into the database. This information includes getting actor information - this is the bit that takes forever. There is an option (checkbox) that offers fetch actor information when updating movies. When you run a scan using the refresh option, the same process happens - but it still gets everything - again.
Here's how I would do things in an ideal world.:
a) Use the list titles option for the first time around; i.e. populating the movie information - but making fetching actor information optional;
b) Use refresh to get the actor information - without having to select from a list of titles.
Here is my reasoning. When I have a load of new movies to scan in, I don't want that process to take forever because the main task here is to get the right title for each movie and to get the movie information into the database - quickly. To cater for only adding a few movies, I would have a checkbox that offers actor downloading as an option. Then I would use the refresh option to load actor information (optionally) when we know that we have the desired titles already set up. In other words, I would change the existing checkbox to refer to fetching actor data irrespective of whether you are scanning for the first time or doing a refresh. Does that make sense to you? For those of you that aren't interested in getting actor information you simply never choose to check the fetch actors option.
Okay. That's the first step. Now for what the application actually does. When you press the Update Database From Selected Shares button, the application calls a method called RebuildDatabase().
This calls the following code:
IMDBFetcher.ScanIMDB(this, availablePaths, _isFuzzyMatching, true, true,
false);
Here is the definition for that method
public static bool ScanIMDB(IMDB.IProgress progress, ArrayList paths, bool fuzzyMatching, bool skipExisting,
bool getActors, bool refreshDBonly)
{
Notice the fifth parameter - bool getActors. See how it is hard-coded to true. This parameter is passed on to two other methods:
GetInfoFromIMDB(progress, ref movieDetails, fuzzyMatching, getActors);
and then
if (RefreshIMDB(progress, ref movieDetails, isFuzzyMatching, getActors, addToDB))
This is why you always get actor data - even when you don't want or need it. This is the required code change:
IMDBFetcher.ScanIMDB(this, availablePaths, _isFuzzyMatching, true, chbFetchActors.Checked,
false);
Job done. But, hold on a minute! I'm still getting actor data! What's going on? Here's the code that gets actors:
if (VideoDatabase.CheckMovieImdbId(_movieDetails.IMDBNumber) && _addToDatabase)
{
line1 = GUILocalizeStrings.Get(344); // **Progress bar actors start sets actual value to 0
OnProgress(line1, _url.Title, string.Empty, 60);
// Do not save movieinfo to database when fetching actors (false paramater) because we don't have all
// movie metadata yet
FetchActorsInMovie(false);
}
No do I need to get actors or not - it just does it anyway. Here's the fix:
if (_getActors)
{
if (VideoDatabase.CheckMovieImdbId(_movieDetails.IMDBNumber) && _addToDatabase)
{
line1 = GUILocalizeStrings.Get(344); // **Progress bar actors start sets actual value to 0
OnProgress(line1, _url.Title, string.Empty, 60);
// Do not save movieinfo to database when fetching actors (false paramater) because we don't have all
// movie metadata yet
FetchActorsInMovie(false);
}
}
_getActors is set in the RefreshIMDB
fetcher._getActors = getActors;
The _getActors setting was being ignored.
But NOOOOO! It still doesn't work. As with everything else in this application everything is SOOOOOO complicated. (My motto is keep it SIMPLE!) The current application stores parameters like this as settings - even when the option is clearly global to the application. Here is a perfect example. When you select whether or not to fetch actors, you are telling the whole configuration application that you don't want actor data for that action. But the settings are stored as an instance of a fetcher; meaning that the setting keeps getting overridden back to false or to the default setting. But this configuration is really at the database level. My solution is to declare a boolean in VideoDatabase called _getActorsOnScan (property GetActorsOnScan). The configuration app sets this to false when it is instantiated. Now, when the checkbox is set ON or OFF, GetActorsOnScan is turned ON/OFF. Now, when you want to scan in actors, or not, the checkbox setting is what determines what happens.
Now, I've got to look at how easy it would be to not keep checking titles for a refresh - on the basis that once you have scanned in movie info, you have already chosen which title you want data for. Then, if you do want to change the title, you can use the Lookup facility for individual movies to make custom changes.
This is what I have been trying to do - get things that seemed to work, but don't, to work. At the same time, I think my option is more user friendly because you get to choose whether to download actor data or not, under all scenarios; not just on refresh. And, when you want to, you can still download actor data for individual or all movies. What wrong with that?