mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-16 21:35:04 -04: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:
@@ -120,7 +120,7 @@ namespace NzbDrone.Core.Indexers.Headphones
|
||||
baseUrl += "&apikey=" + Settings.ApiKey;
|
||||
}
|
||||
|
||||
if (searchCriteria.Limit.HasValue)
|
||||
if (searchCriteria.Limit is > 0)
|
||||
{
|
||||
parameters.Add("limit", searchCriteria.Limit.ToString());
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ namespace NzbDrone.Core.Indexers.Newznab
|
||||
searchUrl += "&apikey=" + Settings.ApiKey;
|
||||
}
|
||||
|
||||
if (searchCriteria.Limit.HasValue)
|
||||
if (searchCriteria.Limit is > 0)
|
||||
{
|
||||
parameters.Set("limit", searchCriteria.Limit.ToString());
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Prowlarr.Api.V1.Search
|
||||
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; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user