From 021401e3b6a75f55783dd628de891725ed84578e Mon Sep 17 00:00:00 2001 From: Sucukdeluxe Date: Sat, 4 Apr 2026 20:21:16 +0200 Subject: [PATCH] Mark companion metadata files (.sfv) as extracted during hybrid extraction SFV files belong to the same archive set as the RAR parts but were not included in hybridFileNames, causing them to stay stuck on "Entpacken - Ausstehend" after the RAR parts were successfully extracted. This blocked package completion in hybrid extraction mode. Fix: collect archive base stems from extracted parts and match companion metadata files (.sfv, .nfo, etc.) by stem, adding them to hybridFileNames so they get marked as "Entpackt" together with their archive parts. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/main/download-manager.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/download-manager.ts b/src/main/download-manager.ts index 1014ce2..4ba3e9a 100644 --- a/src/main/download-manager.ts +++ b/src/main/download-manager.ts @@ -10110,13 +10110,30 @@ export class DownloadManager extends EventEmitter { .filter((entry) => entry.isFile()) .map((entry) => entry.name); } catch { /* ignore */ } + const archiveStems = new Set(); for (const archiveKey of readyArchives) { const parts = collectArchiveCleanupTargets(archiveKey, dirFiles); for (const part of parts) { - hybridFileNames.add(path.basename(part).toLowerCase()); + const partName = path.basename(part).toLowerCase(); + hybridFileNames.add(partName); + // Collect archive base stems (without .partNN.rar / .rar / .rNN) to find companion files + const stem = partName.replace(/\.part\d+\.rar$|\.r\d{2,3}$|\.rar$/i, ""); + if (stem && stem !== partName) archiveStems.add(stem); } hybridFileNames.add(path.basename(archiveKey).toLowerCase()); } + // Include companion metadata files (.sfv, .nfo, etc.) that belong to the same archive set. + // These files share the same basename stem as the archive parts. + if (dirFiles && archiveStems.size > 0) { + for (const fileName of dirFiles) { + const lower = fileName.toLowerCase(); + if (!KNOWN_SMALL_FILE_RE.test(lower)) continue; + const companionStem = lower.replace(/\.[^.]+$/, ""); + if (archiveStems.has(companionStem)) { + hybridFileNames.add(lower); + } + } + } const isHybridItem = (item: DownloadItem): boolean => { if (item.targetPath && hybridFileNames.has(path.basename(item.targetPath).toLowerCase())) { return true;