Fix AllDebrid Rapidgator parallel start limit

This commit is contained in:
Sucukdeluxe
2026-03-08 21:00:55 +01:00
parent eb41b87344
commit 320518dc58
2 changed files with 109 additions and 7 deletions
+11 -2
View File
@@ -5570,16 +5570,25 @@ export class DownloadManager extends EventEmitter {
this.providerStartReservations.set(paceKey, now + activeCount * ALLDEBRID_START_STAGGER_MS);
}
private getConfiguredAllDebridStartLimit(): number {
const configured = Math.floor(Number(this.settings.maxParallel || 1));
if (Number.isFinite(configured) && configured > 0) {
return configured;
}
return 1;
}
private getAllDebridStartLimit(hosterKey: string): number {
if (hosterKey !== "rapidgator") {
return Number.MAX_SAFE_INTEGER;
}
const configuredLimit = this.getConfiguredAllDebridStartLimit();
const cached = this.allDebridHostInfoCache.get(hosterKey);
const apiLimit = cached?.info.limitSimuDl;
if (Number.isFinite(apiLimit) && (apiLimit as number) > 0) {
return Math.max(1, Math.min(2, Math.floor(apiLimit as number)));
return Math.max(1, Math.min(configuredLimit, Math.floor(apiLimit as number)));
}
return 1;
return configuredLimit;
}
private shouldDelayStartForItem(item: DownloadItem): boolean {