From 56c0b633c814ef7da6ba0e2e9486ae5f217ad21c Mon Sep 17 00:00:00 2001 From: Sucukdeluxe Date: Wed, 4 Mar 2026 15:47:48 +0100 Subject: [PATCH] Release v1.6.15 Co-Authored-By: Claude Opus 4.6 --- package.json | 2 +- src/main/download-manager.ts | 4 +++- src/renderer/App.tsx | 22 +++++++++++++++++----- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 53452cc..f335816 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "real-debrid-downloader", - "version": "1.6.14", + "version": "1.6.15", "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 5cb9cdb..76b702f 100644 --- a/src/main/download-manager.ts +++ b/src/main/download-manager.ts @@ -4054,7 +4054,9 @@ export class DownloadManager extends EventEmitter { this.runGlobalStallWatchdog(now); - if (this.activeTasks.size === 0 && !this.hasQueuedItems() && !this.hasDelayedQueuedItems() && this.packagePostProcessTasks.size === 0) { + const downloadsComplete = this.activeTasks.size === 0 && !this.hasQueuedItems() && !this.hasDelayedQueuedItems(); + const postProcessComplete = this.packagePostProcessTasks.size === 0; + if (downloadsComplete && (postProcessComplete || this.settings.autoExtractWhenStopped)) { this.finishRun(); break; } diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index 16803ca..7a3ec6b 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -476,6 +476,7 @@ export function App(): ReactElement { const snapshotRef = useRef(snapshot); snapshotRef.current = snapshot; const tabRef = useRef(tab); + const autoExpandedPkgsRef = useRef(new Set()); tabRef.current = tab; const stateFlushTimerRef = useRef | null>(null); const toastTimerRef = useRef | null>(null); @@ -875,14 +876,25 @@ export function App(): ReactElement { } }, [snapshot.session.running]); - // Auto-expand packages that are currently extracting + // Auto-expand packages that are currently extracting (only once per extraction cycle) useEffect(() => { const extractingPkgIds: string[] = []; + const currentlyExtracting = new Set(); for (const pkg of packages) { - if (collapsedPackages[pkg.id]) { - const items = (pkg.itemIds ?? []).map((id) => snapshot.session.items[id]).filter(Boolean); - const isExtracting = items.some((item) => item.fullStatus?.startsWith("Entpacken -") && !item.fullStatus?.includes("Done")); - if (isExtracting) extractingPkgIds.push(pkg.id); + const items = (pkg.itemIds ?? []).map((id) => snapshot.session.items[id]).filter(Boolean); + const isExtracting = items.some((item) => item.fullStatus?.startsWith("Entpacken -") && !item.fullStatus?.includes("Done")); + if (isExtracting) { + currentlyExtracting.add(pkg.id); + if (collapsedPackages[pkg.id] && !autoExpandedPkgsRef.current.has(pkg.id)) { + extractingPkgIds.push(pkg.id); + autoExpandedPkgsRef.current.add(pkg.id); + } + } + } + // Reset tracking for packages no longer extracting + for (const id of autoExpandedPkgsRef.current) { + if (!currentlyExtracting.has(id)) { + autoExpandedPkgsRef.current.delete(id); } } if (extractingPkgIds.length > 0) {