mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
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:
parent
148fd044ef
commit
460e48d6a1
8 changed files with 33 additions and 697 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue