Fixed: Dedupe titles to avoid similar search requests

This commit is contained in:
Bogdan 2024-08-11 14:40:21 +03:00 committed by Mark McDowall
parent 37c4647f24
commit ffdb08cfe6
2 changed files with 6 additions and 4 deletions

View File

@ -63,7 +63,9 @@ namespace NzbDrone.Core.DataAugmentation.Scene
sceneSeasonNumbers.Contains(n.SceneSeasonNumber ?? -1) ||
((n.SeasonNumber ?? -1) == -1 && (n.SceneSeasonNumber ?? -1) == -1 && n.SceneOrigin != "tvdb"))
.Where(n => IsEnglish(n.SearchTerm))
.Select(n => n.SearchTerm).Distinct().ToList();
.Select(n => n.SearchTerm)
.Distinct(StringComparer.InvariantCultureIgnoreCase)
.ToList();
return names;
}

View File

@ -193,7 +193,7 @@ namespace NzbDrone.Core.IndexerSearch
foreach (var item in dict)
{
item.Value.Episodes = item.Value.Episodes.Distinct().ToList();
item.Value.SceneTitles = item.Value.SceneTitles.Distinct().ToList();
item.Value.SceneTitles = item.Value.SceneTitles.Distinct(StringComparer.InvariantCultureIgnoreCase).ToList();
}
return dict.Values.ToList();
@ -221,7 +221,7 @@ namespace NzbDrone.Core.IndexerSearch
foreach (var item in dict)
{
item.Value.SceneTitles = item.Value.SceneTitles.Distinct().ToList();
item.Value.SceneTitles = item.Value.SceneTitles.Distinct(StringComparer.InvariantCultureIgnoreCase).ToList();
}
return dict.Values.ToList();
@ -463,7 +463,7 @@ namespace NzbDrone.Core.IndexerSearch
spec.UserInvokedSearch = userInvokedSearch;
spec.InteractiveSearch = interactiveSearch;
if (!spec.SceneTitles.Contains(series.Title))
if (!spec.SceneTitles.Contains(series.Title, StringComparer.InvariantCultureIgnoreCase))
{
spec.SceneTitles.Add(series.Title);
}