Add GetBestMatch to TvDbProvider (Provides a way to get the best result from a list of results)

Default value for Quality Dropbox in AddExisting is now the default value from Settings.
This commit is contained in:
Mark McDowall 2011-04-04 19:48:46 -07:00
commit 460e48d6a1
8 changed files with 33 additions and 697 deletions

View file

@ -52,6 +52,23 @@ namespace NzbDrone.Core.Providers
return null;
}
public int GetBestMatch(List<TvdbSearchResult> searchResults, string title)
{
if (searchResults.Count == 0)
return 0;
foreach (var tvdbSearchResult in searchResults)
{
if (IsTitleMatch(tvdbSearchResult.SeriesName, title))
{
Logger.Debug("Search for '{0}' was successful", title);
return tvdbSearchResult.Id;
}
}
return searchResults[0].Id;
}
public TvdbSeries GetSeries(int id, bool loadEpisodes)
{
Logger.Debug("Fetching SeriesId'{0}' from tvdb", id);