From 4008e2027803112d47916219126a1b9a05c19c77 Mon Sep 17 00:00:00 2001 From: Sucukdeluxe Date: Tue, 3 Mar 2026 00:58:28 +0100 Subject: [PATCH] Reset stale status texts on session load and stop - normalizeSessionStatuses: reset all queued items to "Wartet" instead of only checking a few specific patterns (missed Retry, Unrestrict-Fehler etc.) - Reset completed items with stale extraction status to "Fertig (size)" - stop(): reset all non-finished items to queued/"Wartet" and packages to queued Co-Authored-By: Claude Opus 4.6 --- package.json | 2 +- src/main/download-manager.ts | 30 ++++++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1eafa25..f0697df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "real-debrid-downloader", - "version": "1.5.38", + "version": "1.5.39", "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 7411cf2..73131b9 100644 --- a/src/main/download-manager.ts +++ b/src/main/download-manager.ts @@ -2415,6 +2415,23 @@ export class DownloadManager extends EventEmitter { active.abortReason = "stop"; active.abortController.abort("stop"); } + // Reset all non-finished items to clean "Wartet" state + for (const item of Object.values(this.session.items)) { + if (!isFinishedStatus(item.status)) { + item.status = "queued"; + item.speedBps = 0; + item.fullStatus = "Wartet"; + item.updatedAt = nowMs(); + } + } + for (const pkg of Object.values(this.session.packages)) { + if (pkg.status === "downloading" || pkg.status === "validating" + || pkg.status === "extracting" || pkg.status === "integrity_check" + || pkg.status === "paused" || pkg.status === "reconnect_wait") { + pkg.status = "queued"; + pkg.updatedAt = nowMs(); + } + } this.persistSoon(); this.emitState(true); } @@ -2564,13 +2581,18 @@ export class DownloadManager extends EventEmitter { item.speedBps = 0; } // Clear stale transient status texts from previous session - if (item.status === "queued" && item.fullStatus) { - const fs = item.fullStatus.toLowerCase(); - if (fs.includes("provider-cooldown") || fs.includes("warte auf daten") || fs.includes("keine daten") - || fs.includes("link wird umgewandelt") || fs.includes("verbindungsfehler")) { + if (item.status === "queued") { + const fs = (item.fullStatus || "").trim(); + if (fs !== "Wartet" && fs !== "Paket gestoppt") { item.fullStatus = "Wartet"; } } + if (item.status === "completed") { + const fs = (item.fullStatus || "").trim(); + if (fs && !isExtractedLabel(fs) && !/^Fertig\b/i.test(fs)) { + item.fullStatus = `Fertig (${humanSize(item.downloadedBytes)})`; + } + } } for (const pkg of Object.values(this.session.packages)) { if (pkg.enabled === undefined) {