Reset stale status texts on session load and stop
Some checks are pending
Build and Release / build (push) Waiting to run
Some checks are pending
Build and Release / build (push) Waiting to run
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
375b9885ee
commit
4008e20278
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "real-debrid-downloader",
|
"name": "real-debrid-downloader",
|
||||||
"version": "1.5.38",
|
"version": "1.5.39",
|
||||||
"description": "Real-Debrid Downloader Desktop (Electron + React + TypeScript)",
|
"description": "Real-Debrid Downloader Desktop (Electron + React + TypeScript)",
|
||||||
"main": "build/main/main/main.js",
|
"main": "build/main/main/main.js",
|
||||||
"author": "Sucukdeluxe",
|
"author": "Sucukdeluxe",
|
||||||
|
|||||||
@ -2415,6 +2415,23 @@ export class DownloadManager extends EventEmitter {
|
|||||||
active.abortReason = "stop";
|
active.abortReason = "stop";
|
||||||
active.abortController.abort("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.persistSoon();
|
||||||
this.emitState(true);
|
this.emitState(true);
|
||||||
}
|
}
|
||||||
@ -2564,13 +2581,18 @@ export class DownloadManager extends EventEmitter {
|
|||||||
item.speedBps = 0;
|
item.speedBps = 0;
|
||||||
}
|
}
|
||||||
// Clear stale transient status texts from previous session
|
// Clear stale transient status texts from previous session
|
||||||
if (item.status === "queued" && item.fullStatus) {
|
if (item.status === "queued") {
|
||||||
const fs = item.fullStatus.toLowerCase();
|
const fs = (item.fullStatus || "").trim();
|
||||||
if (fs.includes("provider-cooldown") || fs.includes("warte auf daten") || fs.includes("keine daten")
|
if (fs !== "Wartet" && fs !== "Paket gestoppt") {
|
||||||
|| fs.includes("link wird umgewandelt") || fs.includes("verbindungsfehler")) {
|
|
||||||
item.fullStatus = "Wartet";
|
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)) {
|
for (const pkg of Object.values(this.session.packages)) {
|
||||||
if (pkg.enabled === undefined) {
|
if (pkg.enabled === undefined) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user