From 973885a1473a412f668d725805fbbf241b6d82a7 Mon Sep 17 00:00:00 2001 From: Sucukdeluxe Date: Fri, 27 Feb 2026 14:32:07 +0100 Subject: [PATCH] Rescan queued hash names on startup and release v1.3.4 --- package.json | 2 +- src/main/download-manager.ts | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3d91560..b61e46d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "real-debrid-downloader", - "version": "1.3.3", + "version": "1.3.4", "description": "Real-Debrid Downloader Desktop (Electron + React + TypeScript)", "main": "build/main/main/main.js", "author": "Sucukdeluxe", diff --git a/src/main/download-manager.ts b/src/main/download-manager.ts index 4dabed5..dd906c8 100644 --- a/src/main/download-manager.ts +++ b/src/main/download-manager.ts @@ -168,11 +168,13 @@ export class DownloadManager extends EventEmitter { this.applyOnStartCleanupPolicy(); this.normalizeSessionStatuses(); this.recoverPostProcessingOnStartup(); + this.resolveExistingQueuedOpaqueFilenames(); } public setSettings(next: AppSettings): void { this.settings = next; this.debridService.setSettings(next); + this.resolveExistingQueuedOpaqueFilenames(); this.emitState(); } @@ -538,6 +540,29 @@ export class DownloadManager extends EventEmitter { } } + private resolveExistingQueuedOpaqueFilenames(): void { + const unresolvedByLink = new Map(); + for (const item of Object.values(this.session.items)) { + if (!looksLikeOpaqueFilename(item.fileName)) { + continue; + } + if (item.status !== "queued" && item.status !== "reconnect_wait") { + continue; + } + const pkg = this.session.packages[item.packageId]; + if (!pkg || pkg.cancelled) { + continue; + } + const existing = unresolvedByLink.get(item.url) ?? []; + existing.push(item.id); + unresolvedByLink.set(item.url, existing); + } + + if (unresolvedByLink.size > 0) { + void this.resolveQueuedFilenames(unresolvedByLink); + } + } + public cancelPackage(packageId: string): void { const pkg = this.session.packages[packageId]; if (!pkg) {