mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-31 09:38:25 +00:00
fix: bound remote provider pagination
This commit is contained in:
parent
fb763c47bf
commit
5f3e938d09
1 changed files with 2 additions and 1 deletions
|
|
@ -183,6 +183,7 @@ public class SimilarItemsManager : ISimilarItemsManager
|
|||
// Collect references in batches and resolve against local library.
|
||||
// Stop fetching once we have enough resolved local items.
|
||||
const int BatchSize = 20;
|
||||
const int MaxRemoteReferenceFetchLimit = 500;
|
||||
var remaining = requestedLimit - allResults.Count;
|
||||
var collectedReferences = new List<SimilarItemReference>();
|
||||
var pendingBatch = new List<SimilarItemReference>();
|
||||
|
|
@ -199,7 +200,7 @@ public class SimilarItemsManager : ISimilarItemsManager
|
|||
remaining -= resolvedItems.Count;
|
||||
pendingBatch.Clear();
|
||||
|
||||
if (remaining <= 0)
|
||||
if (remaining <= 0 || collectedReferences.Count >= MaxRemoteReferenceFetchLimit)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue