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

View File

@@ -33,6 +33,7 @@ namespace NzbDrone.Core.Indexers
public override bool SupportsRss => true;
public override bool SupportsSearch => true;
public override bool SupportsRedirect => false;
public override bool SupportsPagination => false;
public override Encoding Encoding => Encoding.UTF8;
public override string Language => "en-US";
@@ -60,6 +61,11 @@ namespace NzbDrone.Core.Indexers
return Task.FromResult(new IndexerPageableQueryResult());
}
if (!SupportsPagination && searchCriteria.Offset is > 0)
{
return Task.FromResult(new IndexerPageableQueryResult());
}
return FetchReleases(g => SetCookieFunctions(g).GetSearchRequests(searchCriteria), searchCriteria);
}
@@ -70,6 +76,11 @@ namespace NzbDrone.Core.Indexers
return Task.FromResult(new IndexerPageableQueryResult());
}
if (!SupportsPagination && searchCriteria.Offset is > 0)
{
return Task.FromResult(new IndexerPageableQueryResult());
}
return FetchReleases(g => SetCookieFunctions(g).GetSearchRequests(searchCriteria), searchCriteria);
}
@@ -80,6 +91,11 @@ namespace NzbDrone.Core.Indexers
return Task.FromResult(new IndexerPageableQueryResult());
}
if (!SupportsPagination && searchCriteria.Offset is > 0)
{
return Task.FromResult(new IndexerPageableQueryResult());
}
return FetchReleases(g => SetCookieFunctions(g).GetSearchRequests(searchCriteria), searchCriteria);
}
@@ -90,6 +106,11 @@ namespace NzbDrone.Core.Indexers
return Task.FromResult(new IndexerPageableQueryResult());
}
if (!SupportsPagination && searchCriteria.Offset is > 0)
{
return Task.FromResult(new IndexerPageableQueryResult());
}
return FetchReleases(g => SetCookieFunctions(g).GetSearchRequests(searchCriteria), searchCriteria);
}
@@ -100,6 +121,11 @@ namespace NzbDrone.Core.Indexers
return Task.FromResult(new IndexerPageableQueryResult());
}
if (!SupportsPagination && searchCriteria.Offset is > 0)
{
return Task.FromResult(new IndexerPageableQueryResult());
}
return FetchReleases(g => SetCookieFunctions(g).GetSearchRequests(searchCriteria), searchCriteria);
}