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:
Sucukdeluxe
2026-08-14 21:02:30 +02:00
parent c2d5dbaeb3
commit b80209a10f
20 changed files with 556 additions and 81 deletions
+32 -3
View File
@@ -635,7 +635,7 @@ describe("settings storage", () => {
expect(normalized.archivePasswordList).toBe("one\ntwo\nthree");
});
it("defaults Real-Debrid web login to disabled and normalizes the flag", () => {
it("defaults Real-Debrid web login to disabled and normalizes the flag", () => {
expect(defaultSettings().realDebridUseWebLogin).toBe(false);
const normalizedEnabled = normalizeSettings({
@@ -648,8 +648,37 @@ describe("settings storage", () => {
...defaultSettings(),
realDebridUseWebLogin: 0 as unknown as boolean
});
expect(normalizedDisabled.realDebridUseWebLogin).toBe(false);
});
expect(normalizedDisabled.realDebridUseWebLogin).toBe(false);
});
it("keeps the Real-Debrid service status while web login remains configured", () => {
const checkedAt = Date.now();
const normalized = normalizeSettings({
...defaultSettings(),
realDebridUseWebLogin: true,
debridAccountStatuses: {
"svc-realdebrid": {
accountId: "svc-realdebrid",
provider: "realdebrid",
label: "Real-Debrid",
maskedLogin: "Browser-Login",
valid: true,
isPremium: true,
premiumUntilMs: checkedAt + 1000,
email: "web-user",
message: "Premium aktiv",
checkedAt
}
}
});
expect(normalized.debridAccountStatuses["svc-realdebrid"]).toMatchObject({
accountId: "svc-realdebrid",
provider: "realdebrid",
valid: true,
checkedAt
});
});
it("defaults AllDebrid web login to disabled and normalizes the flag", () => {
expect(defaultSettings().allDebridUseWebLogin).toBe(false);