fix(accounts): restore Real-Debrid start availability

Keep concrete account pools authoritative when fully disabled and clear stale transient cooldown state when an account is explicitly re-enabled, while preserving configured daily limits and usage.
This commit is contained in:
Sucukdeluxe
2026-08-19 19:09:07 +02:00
parent fe3cb36731
commit 09ea7803f3
6 changed files with 92 additions and 7 deletions
+9
View File
@@ -714,6 +714,15 @@ export function pruneRealDebridRuntimeStateForAccounts(activeAccountIds: Set<str
}
}
export function releaseRealDebridAccountCooldown(accountId: string): boolean {
const removed = realDebridAccountCooldowns.delete(accountId);
if (realDebridStickyAccountId === accountId) {
realDebridStickyAccountId = "";
realDebridStickyCount = 0;
}
return removed;
}
export function pruneExpiredRealDebridRuntimeState(now = Date.now()): number {
let removed = 0;
for (const [accountId, detail] of realDebridAccountCooldowns) {