Fixed: (IndexerSearch) Update isRss logic for new properties

pull/1457/head
Qstick 2 years ago
parent af4961e3e6
commit dbc4989a95

@ -122,7 +122,7 @@ namespace NzbDrone.Core.History
{
Date = DateTime.UtcNow,
IndexerId = message.IndexerId,
EventType = message.Query.RssSearch ? HistoryEventType.IndexerRss : HistoryEventType.IndexerQuery,
EventType = message.Query.IsRssSearch ? HistoryEventType.IndexerRss : HistoryEventType.IndexerQuery,
Successful = message.QueryResult.Response?.StatusCode == HttpStatusCode.OK
};

@ -10,6 +10,12 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
public int? Year { get; set; }
public string Genre { get; set; }
public override bool RssSearch => SearchTerm.IsNullOrWhiteSpace() && Author.IsNullOrWhiteSpace() && Title.IsNullOrWhiteSpace();
public override bool IsRssSearch =>
SearchTerm.IsNullOrWhiteSpace() &&
Author.IsNullOrWhiteSpace() &&
Title.IsNullOrWhiteSpace() &&
Publisher.IsNullOrWhiteSpace() &&
Genre.IsNullOrWhiteSpace() &&
!Year.HasValue;
}
}

@ -13,7 +13,14 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
public int? Year { get; set; }
public string Genre { get; set; }
public override bool RssSearch => SearchTerm.IsNullOrWhiteSpace() && ImdbId.IsNullOrWhiteSpace() && !TmdbId.HasValue && !TraktId.HasValue;
public override bool IsRssSearch =>
SearchTerm.IsNullOrWhiteSpace() &&
ImdbId.IsNullOrWhiteSpace() &&
Genre.IsNullOrWhiteSpace() &&
!TmdbId.HasValue &&
!TraktId.HasValue &&
!DoubanId.HasValue &&
!Year.HasValue;
public string FullImdbId => ParseUtil.GetFullImdbId(ImdbId);

@ -11,6 +11,13 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
public string Track { get; set; }
public int? Year { get; set; }
public override bool RssSearch => SearchTerm.IsNullOrWhiteSpace() && Album.IsNullOrWhiteSpace() && Artist.IsNullOrWhiteSpace() && Label.IsNullOrWhiteSpace();
public override bool IsRssSearch =>
SearchTerm.IsNullOrWhiteSpace() &&
Album.IsNullOrWhiteSpace() &&
Artist.IsNullOrWhiteSpace() &&
Label.IsNullOrWhiteSpace() &&
Genre.IsNullOrWhiteSpace() &&
Track.IsNullOrWhiteSpace() &&
!Year.HasValue;
}
}

@ -24,7 +24,7 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
public virtual string SearchQuery => $"Term: [{SearchTerm}]";
public virtual bool RssSearch => SearchTerm.IsNullOrWhiteSpace();
public virtual bool IsRssSearch => SearchTerm.IsNullOrWhiteSpace();
public string SanitizedSearchTerm => GetSanitizedTerm(SearchTerm);

@ -26,7 +26,17 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
public string FullImdbId => ParseUtil.GetFullImdbId(ImdbId);
public override bool RssSearch => SearchTerm.IsNullOrWhiteSpace() && ImdbId.IsNullOrWhiteSpace() && !TvdbId.HasValue && !RId.HasValue && !TraktId.HasValue && !TvMazeId.HasValue;
public override bool IsRssSearch =>
SearchTerm.IsNullOrWhiteSpace() &&
Episode.IsNullOrWhiteSpace() &&
ImdbId.IsNullOrWhiteSpace() &&
!Season.HasValue &&
!TvdbId.HasValue &&
!RId.HasValue &&
!TraktId.HasValue &&
!TvMazeId.HasValue &&
!TmdbId.HasValue &&
!DoubanId.HasValue;
public override string SearchQuery
{

@ -129,7 +129,7 @@ namespace NzbDrone.Core.Indexers.Definitions
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(searchCriteria.RssSearch
pageableRequests.Add(searchCriteria.IsRssSearch
? GetRssRequest()
: GetSearchRequests(searchCriteria.SanitizedTvSearchString));
@ -147,7 +147,7 @@ namespace NzbDrone.Core.Indexers.Definitions
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(searchCriteria.RssSearch
pageableRequests.Add(searchCriteria.IsRssSearch
? GetRssRequest()
: GetSearchRequests(searchCriteria.SanitizedSearchTerm));

Loading…
Cancel
Save