public List<DBMovieInfo> Get(MovieSignature movieSignature)
{
List<DBSourceInfo> sources;
lock (detailSources) sources = new List<DBSourceInfo>(detailSources);
// Try each datasource (ordered by their priority) to get results
List<DBMovieInfo> results = new List<DBMovieInfo>();
foreach (DBSourceInfo currSource in sources) {
if (currSource.IsDisabled(DataType.DETAILS))
continue;
// if we have reached the minimum number of possible matches required, we are done
if (results.Count >= MovingPicturesCore.Settings.MinimumMatches &&
MovingPicturesCore.Settings.MinimumMatches != 0)
break;
// search with the current provider
List<DBMovieInfo> newResults = currSource.Provider.Get(movieSignature);
// tag the results with the current source
foreach (DBMovieInfo currMovie in newResults)
currMovie.PrimarySource = currSource;
// add results to our total result list and log what we found
results.AddRange(newResults);
logger.Debug("SEARCH: Title='{0}', Provider='{1}', Version={2}, Number of Results={3}", movieSignature.Title, currSource.Provider.Name, currSource.Provider.Version, newResults.Count);
}
return results;
}