mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-05-08 12:43:19 +02:00
Fixed: Don't send limit=0 to Newznab indexers
When searching via the internal API, SearchResource.Limit defaults to 0 because it's a non-nullable int. This gets passed through to the Newznab request generator, which emits &limit=0 in the query URL. Indexers that follow the Newznab spec honor limit=0 literally and return zero results. Confirmed affected: DrunkenSlug and NZBGeek. Changed Limit and Offset on SearchResource to int? so they default to null when omitted, matching the existing behavior in NewznabRequest. Also guard against emitting limit=0 or offset=0 in the request generators.
This commit is contained in:
parent
0ffcfccf1d
commit
c5a864469f
3 changed files with 6 additions and 6 deletions
|
|
@ -120,12 +120,12 @@ private IEnumerable<IndexerRequest> GetPagedRequests(SearchCriteriaBase searchCr
|
|||
baseUrl += "&apikey=" + Settings.ApiKey;
|
||||
}
|
||||
|
||||
if (searchCriteria.Limit.HasValue)
|
||||
if (searchCriteria.Limit.HasValue && searchCriteria.Limit.Value > 0)
|
||||
{
|
||||
parameters.Add("limit", searchCriteria.Limit.ToString());
|
||||
}
|
||||
|
||||
if (searchCriteria.Offset.HasValue)
|
||||
if (searchCriteria.Offset.HasValue && searchCriteria.Offset.Value > 0)
|
||||
{
|
||||
parameters.Add("offset", searchCriteria.Offset.ToString());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -263,12 +263,12 @@ private IEnumerable<IndexerRequest> GetPagedRequests(SearchCriteriaBase searchCr
|
|||
searchUrl += "&apikey=" + Settings.ApiKey;
|
||||
}
|
||||
|
||||
if (searchCriteria.Limit.HasValue)
|
||||
if (searchCriteria.Limit.HasValue && searchCriteria.Limit.Value > 0)
|
||||
{
|
||||
parameters.Set("limit", searchCriteria.Limit.ToString());
|
||||
}
|
||||
|
||||
if (searchCriteria.Offset.HasValue)
|
||||
if (searchCriteria.Offset.HasValue && searchCriteria.Offset.Value > 0)
|
||||
{
|
||||
parameters.Set("offset", searchCriteria.Offset.ToString());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public SearchResource()
|
|||
public string Type { get; set; }
|
||||
public List<int> IndexerIds { get; set; }
|
||||
public List<int> Categories { get; set; }
|
||||
public int Limit { get; set; }
|
||||
public int Offset { get; set; }
|
||||
public int? Limit { get; set; }
|
||||
public int? Offset { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue