Retry failed extractions on unpause, fix delete callback deps

- triggerPendingExtractions() now runs when unpausing, so packages
  with extraction errors are automatically retried
- executeDeleteSelection no longer depends on snapshot objects
  (prevents unnecessary re-renders with large queues)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sucukdeluxe 2026-03-02 19:58:01 +01:00
parent 430ec7352b
commit ecf56cb977
3 changed files with 12 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "real-debrid-downloader", "name": "real-debrid-downloader",
"version": "1.5.13", "version": "1.5.14",
"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",

View File

@ -2484,6 +2484,9 @@ export class DownloadManager extends EventEmitter {
active.abortController.abort("stall"); active.abortController.abort("stall");
} }
} }
// Retry failed extractions after unpause
this.triggerPendingExtractions();
} }
this.persistSoon(); this.persistSoon();

View File

@ -1584,12 +1584,15 @@ export function App(): ReactElement {
}, [contextMenu]); }, [contextMenu]);
const executeDeleteSelection = useCallback((ids: Set<string>): void => { const executeDeleteSelection = useCallback((ids: Set<string>): void => {
for (const id of ids) { setSnapshot((prev) => {
if (snapshot.session.items[id]) void window.rd.removeItem(id); for (const id of ids) {
else if (snapshot.session.packages[id]) onPackageCancel(id); if (prev.session.items[id]) void window.rd.removeItem(id);
} else if (prev.session.packages[id]) void window.rd.cancelPackage(id);
}
return prev;
});
setSelectedIds(new Set()); setSelectedIds(new Set());
}, [snapshot.session.items, snapshot.session.packages, onPackageCancel]); }, []);
const requestDeleteSelection = useCallback((): void => { const requestDeleteSelection = useCallback((): void => {
if (selectedIds.size === 0) return; if (selectedIds.size === 0) return;