Rename QueryTitles to CleanSceneTitles in SearchCriteriaBase

This commit is contained in:
Mark McDowall 2021-10-05 12:00:59 -07:00
parent eb4a9f624e
commit 747a4164e2
8 changed files with 15 additions and 15 deletions

View File

@ -18,7 +18,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
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);
}
}
}

View File

@ -31,7 +31,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
.Setup(s => s.GetSeries(It.IsAny<int>()))
.Returns(_series);
Mocker.GetMock<ISearchForNzb>()
Mocker.GetMock<ISearchForReleases>()
.Setup(s => s.SeasonSearch(_series.Id, It.IsAny<int>(), false, false, true, false))
.Returns(new List<DownloadDecision>());
@ -51,7 +51,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
Subject.Execute(new SeriesSearchCommand { SeriesId = _series.Id, Trigger = CommandTrigger.Manual });
Mocker.GetMock<ISearchForNzb>()
Mocker.GetMock<ISearchForReleases>()
.Verify(v => v.SeasonSearch(_series.Id, It.IsAny<int>(), false, true, true, false), Times.Exactly(_series.Seasons.Count(s => s.Monitored)));
}
@ -67,7 +67,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
new Season { SeasonNumber = 2, Monitored = true }
};
Mocker.GetMock<ISearchForNzb>()
Mocker.GetMock<ISearchForReleases>()
.Setup(s => s.SeasonSearch(_series.Id, It.IsAny<int>(), false, true, true, false))
.Returns(new List<DownloadDecision>())
.Callback<int, int, bool, bool, bool, bool>((seriesId, seasonNumber, missingOnly, monitoredOnly, userInvokedSearch, interactiveSearch) => seasonOrder.Add(seasonNumber));

View File

@ -22,9 +22,9 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
public virtual bool UserInvokedSearch { get; set; }
public virtual bool InteractiveSearch { get; set; }
public List<string> QueryTitles => SceneTitles.Select(GetQueryTitle).Distinct().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();

View File

@ -181,7 +181,7 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet
if (AddSeriesSearchParameters(parameters, searchCriteria))
{
var episodeQueryTitle = searchCriteria.Episodes.Where(e => !string.IsNullOrWhiteSpace(e.Title))
.Select(e => SearchCriteriaBase.GetQueryTitle(e.Title))
.Select(e => SearchCriteriaBase.GetCleanSceneTitle(e.Title))
.ToArray();
foreach (var queryTitle in episodeQueryTitle)

View File

@ -53,7 +53,7 @@ namespace NzbDrone.Core.Indexers.Fanzub
{
var pageableRequests = new IndexerPageableRequestChain();
var searchTitles = searchCriteria.QueryTitles.SelectMany(v => GetTitleSearchStrings(v, searchCriteria.AbsoluteEpisodeNumber)).ToList();
var searchTitles = searchCriteria.CleanSceneTitles.SelectMany(v => GetTitleSearchStrings(v, searchCriteria.AbsoluteEpisodeNumber)).ToList();
pageableRequests.Add(GetPagedRequests(string.Join("|", searchTitles)));

View File

@ -314,7 +314,7 @@ namespace NzbDrone.Core.Indexers.Newznab
if (SupportsSearch)
{
var queryTitles = (TextSearchEngine == "raw" ? searchCriteria.SceneTitles : searchCriteria.QueryTitles);
var queryTitles = (TextSearchEngine == "raw" ? searchCriteria.SceneTitles : searchCriteria.CleanSceneTitles);
foreach (var queryTitle in queryTitles)
{
pageableRequests.Add(GetPagedRequests(MaxPages, Settings.AnimeCategories, "search",
@ -419,7 +419,7 @@ namespace NzbDrone.Core.Indexers.Newznab
}
else if (SupportsTvSearch)
{
var queryTitles = TvTextSearchEngine == "raw" ? searchCriteria.SceneTitles : searchCriteria.QueryTitles;
var queryTitles = TvTextSearchEngine == "raw" ? searchCriteria.SceneTitles : searchCriteria.CleanSceneTitles;
foreach (var queryTitle in queryTitles)
{
chain.Add(GetPagedRequests(MaxPages, Settings.Categories, "tvsearch",

View File

@ -50,7 +50,7 @@ namespace NzbDrone.Core.Indexers.Nyaa
{
var pageableRequests = new IndexerPageableRequestChain();
foreach (var queryTitle in searchCriteria.QueryTitles)
foreach (var queryTitle in searchCriteria.CleanSceneTitles)
{
var searchTitle = PrepareQuery(queryTitle);

View File

@ -29,7 +29,7 @@ namespace NzbDrone.Core.Indexers.Omgwtfnzbs
{
var pageableRequests = new IndexerPageableRequestChain();
foreach (var queryTitle in searchCriteria.QueryTitles)
foreach (var queryTitle in searchCriteria.CleanSceneTitles)
{
pageableRequests.Add(GetPagedRequests(string.Format("{0}+S{1:00}E{2:00}",
queryTitle,
@ -44,7 +44,7 @@ namespace NzbDrone.Core.Indexers.Omgwtfnzbs
{
var pageableRequests = new IndexerPageableRequestChain();
foreach (var queryTitle in searchCriteria.QueryTitles)
foreach (var queryTitle in searchCriteria.CleanSceneTitles)
{
pageableRequests.Add(GetPagedRequests(string.Format("{0}+S{1:00}",
queryTitle,
@ -58,7 +58,7 @@ namespace NzbDrone.Core.Indexers.Omgwtfnzbs
{
var pageableRequests = new IndexerPageableRequestChain();
foreach (var queryTitle in searchCriteria.QueryTitles)
foreach (var queryTitle in searchCriteria.CleanSceneTitles)
{
pageableRequests.Add(GetPagedRequests(string.Format("{0}+{1:yyyy MM dd}",
queryTitle,
@ -72,7 +72,7 @@ namespace NzbDrone.Core.Indexers.Omgwtfnzbs
{
var pageableRequests = new IndexerPageableRequestChain();
foreach (var queryTitle in searchCriteria.QueryTitles)
foreach (var queryTitle in searchCriteria.CleanSceneTitles)
{
pageableRequests.Add(GetPagedRequests(string.Format("{0}+{1}",
queryTitle,