fix(updater): migrate legacy release repositories

Redirect settings that still reference the former private repositories to the public GitHub release source so existing installations can discover v2.0.1 and later updates.
This commit is contained in:
Sucukdeluxe
2026-08-09 13:38:53 +02:00
parent 766bf9a616
commit 0560ef6650
4 changed files with 30 additions and 17 deletions
+16 -5
View File
@@ -71,7 +71,7 @@ describe("settings storage", () => {
expect(loaded.allDebridToken).toBe("all-token");
});
it("normalizes invalid enum and numeric values", () => {
it("normalizes invalid enum and numeric values", () => {
const normalized = normalizeSettings({
...defaultSettings(),
providerPrimary: "invalid-provider" as unknown as AppSettings["providerPrimary"],
@@ -105,10 +105,21 @@ describe("settings storage", () => {
expect(normalized.outputDir).toBe(defaultSettings().outputDir);
expect(normalized.extractDir).toBe(defaultSettings().extractDir);
expect(normalized.mkvLibraryDir).toBe(defaultSettings().mkvLibraryDir);
expect(normalized.updateRepo).toBe(defaultSettings().updateRepo);
});
it("normalizes malformed persisted config on load", () => {
expect(normalized.updateRepo).toBe(defaultSettings().updateRepo);
});
it("migrates the previous private update repository to the public release repository", () => {
for (const updateRepo of [
"legacy-owner/real-debrid-downloader",
"legacy-owner/multi-debrid-downloader",
"legacy-owner/real-debrid-downloader.git"
]) {
const normalized = normalizeSettings({ ...defaultSettings(), updateRepo });
expect(normalized.updateRepo).toBe(defaultSettings().updateRepo);
}
});
it("normalizes malformed persisted config on load", () => {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "rd-store-"));
tempDirs.push(dir);
const paths = createStoragePaths(dir);