1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-12 11:15:43 +02:00

Modified TvDbProvider to aloow returning of multiple results when requesting a list of results.

This commit is contained in:
Mark McDowall 2011-03-10 12:30:22 -08:00
parent 48b89abfeb
commit c3425f493f

View File

@ -27,17 +27,9 @@ public TvDbProvider()
public IList<TvdbSearchResult> SearchSeries(string title)
{
Logger.Debug("Searching TVDB for '{0}'", title);
var result = new List<TvdbSearchResult>();
var result = _handler.SearchSeries(title);
foreach (var tvdbSearchResult in _handler.SearchSeries(title))
{
if (IsTitleMatch(tvdbSearchResult.SeriesName, title))
{
result.Add(tvdbSearchResult);
}
}
Logger.Debug("Search for '{0}' returned {1} results", title, result.Count);
Logger.Debug("Search for '{0}' returned {1} possible results", title, result.Count);
return result;
}
@ -48,7 +40,16 @@ public TvdbSearchResult GetSeries(string title)
if (searchResults.Count == 0)
return null;
return searchResults[0];
foreach (var tvdbSearchResult in searchResults)
{
if (IsTitleMatch(tvdbSearchResult.SeriesName, title))
{
Logger.Debug("Search for '{0}' was successful", title);
return tvdbSearchResult;
}
}
return null;
}
public TvdbSeries GetSeries(int id, bool loadEpisodes)