mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-18 08:19:38 +02:00
Rename QueryTitles to CleanSceneTitles in SearchCriteriaBase
(cherry picked from commit 747a4164e24e9861cacad39cf7d94db398747b38)
This commit is contained in:
parent
183d3d0872
commit
b18daebc8a
@ -18,7 +18,7 @@ public class SearchDefinitionFixture : CoreTest<MovieSearchCriteria>
|
||||
public void should_replace_some_special_characters(string input, string expected)
|
||||
{
|
||||
Subject.SceneTitles = new List<string> { input };
|
||||
Subject.QueryTitles.First().Should().Be(expected);
|
||||
Subject.CleanSceneTitles.First().Should().Be(expected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ public abstract class SearchCriteriaBase
|
||||
public virtual bool UserInvokedSearch { get; set; }
|
||||
public virtual bool InteractiveSearch { get; set; }
|
||||
|
||||
public List<string> QueryTitles => SceneTitles.Select(GetQueryTitle).ToList();
|
||||
public List<string> CleanSceneTitles => SceneTitles.Select(GetCleanSceneTitle).Distinct().ToList();
|
||||
|
||||
public static string GetQueryTitle(string title)
|
||||
public static string GetCleanSceneTitle(string title)
|
||||
{
|
||||
Ensure.That(title, () => title).IsNotNullOrWhiteSpace();
|
||||
|
||||
|
@ -30,7 +30,7 @@ public virtual IndexerPageableRequestChain GetSearchRequests(MovieSearchCriteria
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var queryTitle in searchCriteria.QueryTitles)
|
||||
foreach (var queryTitle in searchCriteria.CleanSceneTitles)
|
||||
{
|
||||
var titleYearSearchQuery = string.Format("{0}+{1}", queryTitle, searchCriteria.Movie.Year);
|
||||
pageableRequests.Add(GetRequest("search-torrents", string.Format("&type=name&query={0}", titleYearSearchQuery.Trim())));
|
||||
|
@ -155,7 +155,7 @@ private void AddMovieIdPageableRequests(IndexerPageableRequestChain chain, int m
|
||||
if (SupportsSearch)
|
||||
{
|
||||
chain.AddTier();
|
||||
var queryTitles = TextSearchEngine == "raw" ? searchCriteria.SceneTitles : searchCriteria.QueryTitles;
|
||||
var queryTitles = TextSearchEngine == "raw" ? searchCriteria.SceneTitles : searchCriteria.CleanSceneTitles;
|
||||
foreach (var queryTitle in queryTitles)
|
||||
{
|
||||
var searchQuery = queryTitle;
|
||||
|
@ -60,7 +60,7 @@ public IndexerPageableRequestChain GetSearchRequests(MovieSearchCriteria searchC
|
||||
{
|
||||
var pageableRequests = new IndexerPageableRequestChain();
|
||||
|
||||
foreach (var queryTitle in searchCriteria.QueryTitles)
|
||||
foreach (var queryTitle in searchCriteria.CleanSceneTitles)
|
||||
{
|
||||
pageableRequests.Add(GetPagedRequests(MaxPages, PrepareQuery(string.Format("{0} {1}", queryTitle, searchCriteria.Movie.Year))));
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public IndexerPageableRequestChain GetSearchRequests(MovieSearchCriteria searchC
|
||||
{
|
||||
var pageableRequests = new IndexerPageableRequestChain();
|
||||
|
||||
foreach (var queryTitle in searchCriteria.QueryTitles)
|
||||
foreach (var queryTitle in searchCriteria.CleanSceneTitles)
|
||||
{
|
||||
pageableRequests.Add(GetPagedRequests(string.Format("{0}",
|
||||
queryTitle)));
|
||||
|
@ -35,7 +35,7 @@ public IndexerPageableRequestChain GetSearchRequests(MovieSearchCriteria searchC
|
||||
}
|
||||
else if (searchCriteria.Movie.Year > 0)
|
||||
{
|
||||
foreach (var queryTitle in searchCriteria.QueryTitles)
|
||||
foreach (var queryTitle in searchCriteria.CleanSceneTitles)
|
||||
{
|
||||
pageableRequests.Add(GetRequest(string.Format("{0}&year={1}", queryTitle, searchCriteria.Movie.Year)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user