Fixed: (Indexers) Add SupportsPagination to prevent fetching the first page multiple times

This commit is contained in:
Bogdan
2023-03-05 18:37:04 +02:00
parent d4c5e39c9c
commit 4348ebe187
22 changed files with 69 additions and 45 deletions
@@ -165,6 +165,7 @@ namespace NzbDrone.Core.Indexers.Cardigann
SupportsRss = SupportsRss,
SupportsSearch = SupportsSearch,
SupportsRedirect = SupportsRedirect,
SupportsPagination = SupportsPagination,
Capabilities = new IndexerCapabilities(),
ExtraFields = settings
};
@@ -1022,15 +1022,6 @@ namespace NzbDrone.Core.Indexers.Cardigann
private IEnumerable<IndexerRequest> GetRequest(Dictionary<string, object> variables, SearchCriteriaBase searchCriteria)
{
var limit = searchCriteria.Limit ?? 100;
var offset = searchCriteria.Offset ?? 0;
if (offset > 0 && limit > 0 && offset / limit > 0)
{
// Pagination doesn't work yet, this is to prevent fetching the first page multiple times.
yield break;
}
var search = _definition.Search;
var mappedCategories = _categories.MapTorznabCapsToTrackers((int[])variables[".Query.Categories"]);