fix(realdebrid): persist web status and report relevant provider errors
Check Real-Debrid API and browser sessions through the account status flow, retain the service status across settings updates, and refresh the account row when a browser login is detected. Exclude unavailable providers that were never attempted from conversion failures and prevent aggregated fallback text from being mislabeled as a Debrid-Link terminal error. Bump the development version to 2.0.37 and add focused regression coverage.
This commit is contained in:
+9
-8
@@ -3964,8 +3964,8 @@ export class DebridService {
|
||||
}
|
||||
|
||||
let configuredFound = false;
|
||||
let limitReachedFound = false;
|
||||
const attempts: string[] = [];
|
||||
const attempts: string[] = [];
|
||||
const unavailableProviders: string[] = [];
|
||||
|
||||
for (const provider of order) {
|
||||
if (!this.isProviderConfiguredFor(settings, provider)) {
|
||||
@@ -3973,9 +3973,8 @@ export class DebridService {
|
||||
}
|
||||
configuredFound = true;
|
||||
if (this.isProviderDailyLimited(settings, provider)) {
|
||||
limitReachedFound = true;
|
||||
logger.info(`Provider-Kette: ${PROVIDER_LABELS[provider]} uebersprungen (${this.formatProviderLimitMessage(settings, provider)})`);
|
||||
attempts.push(this.formatProviderLimitMessage(settings, provider));
|
||||
logger.info(`Provider-Kette: ${PROVIDER_LABELS[provider]} uebersprungen (${this.formatProviderLimitMessage(settings, provider)})`);
|
||||
unavailableProviders.push(this.formatProviderLimitMessage(settings, provider));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -4024,9 +4023,11 @@ export class DebridService {
|
||||
if (!configuredFound) {
|
||||
throw new Error("Kein Debrid-Provider konfiguriert");
|
||||
}
|
||||
if (limitReachedFound && attempts.every((entry) => /Tageslimit erreicht$/i.test(entry))) {
|
||||
throw new Error("Alle konfigurierten Provider haben ihr Tageslimit erreicht");
|
||||
}
|
||||
if (attempts.length === 0 && unavailableProviders.length > 0) {
|
||||
throw new Error(unavailableProviders.length === 1
|
||||
? unavailableProviders[0]
|
||||
: `Alle konfigurierten Provider sind nicht verfügbar: ${unavailableProviders.join(" | ")}`);
|
||||
}
|
||||
|
||||
throw new Error(`Unrestrict fehlgeschlagen: ${attempts.join(" | ")}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user