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 (#2654)
* 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 in the request generators. Co-authored-by: Daniel Jacobs <danielj@certida.com> Co-authored-by: Bogdan <mynameisbogdan@users.noreply.github.com>
This commit is contained in:
parent
b2d49164bc
commit
c687bdb1fb
3 changed files with 4 additions and 4 deletions
|
|
@ -120,7 +120,7 @@ private IEnumerable<IndexerRequest> GetPagedRequests(SearchCriteriaBase searchCr
|
|||
baseUrl += "&apikey=" + Settings.ApiKey;
|
||||
}
|
||||
|
||||
if (searchCriteria.Limit.HasValue)
|
||||
if (searchCriteria.Limit is > 0)
|
||||
{
|
||||
parameters.Add("limit", searchCriteria.Limit.ToString());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ private IEnumerable<IndexerRequest> GetPagedRequests(SearchCriteriaBase searchCr
|
|||
searchUrl += "&apikey=" + Settings.ApiKey;
|
||||
}
|
||||
|
||||
if (searchCriteria.Limit.HasValue)
|
||||
if (searchCriteria.Limit is > 0)
|
||||
{
|
||||
parameters.Set("limit", searchCriteria.Limit.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