Fixed: Duplicate scene titles causes unnecessary indexer queries.

fixes #2068
This commit is contained in:
Indrek Ardel 2017-07-26 17:14:10 +03:00 committed by Taloth
parent 126b849c27
commit 5c4dc9ccb1
2 changed files with 7 additions and 4 deletions

View File

@ -19,7 +19,7 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
public virtual bool MonitoredEpisodesOnly { get; set; }
public virtual bool UserInvokedSearch { get; set; }
public List<string> QueryTitles => SceneTitles.Select(GetQueryTitle).ToList();
public List<string> QueryTitles => SceneTitles.Select(GetQueryTitle).Distinct().ToList();
public static string GetQueryTitle(string title)
{
@ -37,4 +37,4 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
return cleanTitle.Trim('+', ' ');
}
}
}
}

View File

@ -237,9 +237,12 @@ namespace NzbDrone.Core.IndexerSearch
episodes.Select(e => e.SeasonNumber).Distinct().ToList(),
episodes.Select(e => e.SceneSeasonNumber ?? e.SeasonNumber).Distinct().ToList());
spec.Episodes = episodes;
if (!spec.SceneTitles.Contains(series.Title))
{
spec.SceneTitles.Add(series.Title);
}
spec.SceneTitles.Add(series.Title);
spec.Episodes = episodes;
spec.UserInvokedSearch = userInvokedSearch;
return spec;