mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-04-21 12:20:59 +02:00
Fixed: (IndexerSearch) Update isRss logic for new properties
This commit is contained in:
parent
af4961e3e6
commit
dbc4989a95
7 changed files with 38 additions and 8 deletions
|
|
@ -122,7 +122,7 @@ public void Handle(IndexerQueryEvent message)
|
|||
{
|
||||
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 @@ public class BookSearchCriteria : SearchCriteriaBase
|
|||
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 @@ public class MovieSearchCriteria : SearchCriteriaBase
|
|||
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 @@ public class MusicSearchCriteria : SearchCriteriaBase
|
|||
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 @@ public abstract class SearchCriteriaBase
|
|||
|
||||
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 @@ public class TvSearchCriteria : SearchCriteriaBase
|
|||
|
||||
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 @@ public IndexerPageableRequestChain GetSearchRequests(TvSearchCriteria searchCrit
|
|||
{
|
||||
var pageableRequests = new IndexerPageableRequestChain();
|
||||
|
||||
pageableRequests.Add(searchCriteria.RssSearch
|
||||
pageableRequests.Add(searchCriteria.IsRssSearch
|
||||
? GetRssRequest()
|
||||
: GetSearchRequests(searchCriteria.SanitizedTvSearchString));
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ public IndexerPageableRequestChain GetSearchRequests(BasicSearchCriteria searchC
|
|||
{
|
||||
var pageableRequests = new IndexerPageableRequestChain();
|
||||
|
||||
pageableRequests.Add(searchCriteria.RssSearch
|
||||
pageableRequests.Add(searchCriteria.IsRssSearch
|
||||
? GetRssRequest()
|
||||
: GetSearchRequests(searchCriteria.SanitizedSearchTerm));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue