Separate pause/resume buttons, fix hybrid extraction during pause

- Pause button is now one-way (orange glow when paused, disabled when
  already paused). Start button resumes from pause.
- Fix hybrid extraction attempting incomplete multi-part archives when
  paused: disk-fallback now blocks any non-terminal item status, not
  just downloading/validating/integrity_check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sucukdeluxe 2026-03-02 19:22:58 +01:00
parent e6c17393fb
commit 549328893e
4 changed files with 22 additions and 13 deletions

View File

@ -1,6 +1,6 @@
{
"name": "real-debrid-downloader",
"version": "1.5.1",
"version": "1.5.11",
"description": "Real-Debrid Downloader Desktop (Electron + React + TypeScript)",
"main": "build/main/main/main.js",
"author": "Sucukdeluxe",

View File

@ -4786,7 +4786,7 @@ export class DownloadManager extends EventEmitter {
}
const anyActivelyProcessing = missingParts.some((part) => {
const status = pendingItemStatus.get(pathKey(part));
return status === "downloading" || status === "validating" || status === "integrity_check";
return status !== undefined && status !== "failed" && status !== "cancelled";
});
if (anyActivelyProcessing) {
continue;

View File

@ -1903,18 +1903,25 @@ export function App(): ReactElement {
<div className="buttons buttons-left">
<button
className="ctrl-icon-btn ctrl-play"
title="Start"
disabled={actionBusy || !snapshot.canStart}
onClick={() => { void onStartDownloads(); }}
title={snapshot.session.paused ? "Fortsetzen" : "Start"}
disabled={actionBusy || (!snapshot.canStart && !snapshot.session.paused)}
onClick={() => {
if (snapshot.session.paused) {
setSnapshot((prev) => ({ ...prev, session: { ...prev.session, paused: false } }));
void window.rd.togglePause();
} else {
void onStartDownloads();
}
}}
>
<svg viewBox="0 0 24 24" width="18" height="18"><polygon points="6,3 20,12 6,21" fill="currentColor" /></svg>
</button>
<button
className={`ctrl-icon-btn ctrl-pause${snapshot.session.running && !snapshot.session.paused ? " active" : ""}${snapshot.session.paused ? " paused" : ""}`}
title={snapshot.session.paused ? "Fortsetzen" : "Pause"}
disabled={!snapshot.canPause}
className={`ctrl-icon-btn ctrl-pause${snapshot.session.paused ? " paused" : ""}`}
title="Pause"
disabled={!snapshot.canPause || snapshot.session.paused}
onClick={() => {
setSnapshot((prev) => ({ ...prev, session: { ...prev.session, paused: !prev.session.paused } }));
setSnapshot((prev) => ({ ...prev, session: { ...prev.session, paused: true } }));
void window.rd.togglePause();
}}
>

View File

@ -323,16 +323,18 @@ body,
background: rgba(74, 222, 128, 0.1);
}
.ctrl-icon-btn.ctrl-pause.active {
color: var(--accent);
}
.ctrl-icon-btn.ctrl-pause:not(:disabled):hover {
border-color: #f59e0b;
color: #f59e0b;
background: rgba(245, 158, 11, 0.1);
}
.ctrl-icon-btn.ctrl-pause.paused {
border-color: #f59e0b;
color: #f59e0b;
background: rgba(245, 158, 11, 0.15);
}
.ctrl-icon-btn.ctrl-stop:not(:disabled) {
color: var(--danger);
}