mirror of
https://github.com/Radarr/Radarr
synced 2025-01-01 04:45:35 +00:00
Added: Search 5 alternative titles as well. This should help with french as well as movies with very different titles.
This commit is contained in:
parent
09c86013b0
commit
d81e3a79cf
1 changed files with 12 additions and 1 deletions
|
@ -59,7 +59,18 @@ public IndexerPageableRequestChain GetSearchRequests(MovieSearchCriteria searchC
|
|||
else
|
||||
{
|
||||
var searchTitle = System.Web.HttpUtility.UrlPathEncode(Parser.Parser.ReplaceGermanUmlauts(Parser.Parser.NormalizeTitle(searchCriteria.Movie.Title)));
|
||||
pageableRequests.Add(GetPagedRequests(MaxPages, Settings.Categories, "search", $"&q={searchTitle}%20{searchCriteria.Movie.Year}"));
|
||||
var altTitles = searchCriteria.Movie.AlternativeTitles.DistinctBy(t => Parser.Parser.CleanSeriesTitle(t)).Take(5).ToList();
|
||||
|
||||
var realMaxPages = (int)MaxPages / (altTitles.Count() + 1);
|
||||
|
||||
pageableRequests.Add(GetPagedRequests(MaxPages - (altTitles.Count() * realMaxPages), Settings.Categories, "search", $"&q={searchTitle}%20{searchCriteria.Movie.Year}"));
|
||||
|
||||
//Also use alt titles for searching.
|
||||
foreach (String altTitle in altTitles)
|
||||
{
|
||||
var searchAltTitle = System.Web.HttpUtility.UrlPathEncode(Parser.Parser.ReplaceGermanUmlauts(Parser.Parser.NormalizeTitle(altTitle)));
|
||||
pageableRequests.Add(GetPagedRequests(realMaxPages, Settings.Categories, "search", $"&q={searchAltTitle}%20{searchCriteria.Movie.Year}"));
|
||||
}
|
||||
}
|
||||
|
||||
return pageableRequests;
|
||||
|
|
Loading…
Reference in a new issue