Fix companion files stuck at extraction labels in hybrid mode

When all archive parts were already extracted in a prior hybrid round and
a companion file (.sfv, .nfo, .md5) downloads later, result.extracted is
0 so the companion's status was never updated from "Entpacken - Ausstehend"
or "Entpacken - Warten auf Parts".

Now companion metadata files are explicitly marked as "Entpackt (Metadaten)"
when no archives need extraction and no failures occurred, preventing them
from blocking package completion indefinitely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sucukdeluxe 2026-04-04 20:41:38 +02:00
parent 85889de790
commit 711147fc10

View File

@ -10457,8 +10457,13 @@ export class DownloadManager extends EventEmitter {
entry.fullStatus = "Entpacken - Error";
} else if (result.extracted > 0) {
entry.fullStatus = formatExtractDone(nowMs() - hybridExtractStartMs);
} else if (KNOWN_SMALL_FILE_RE.test(entry.fileName || "")) {
// Companion metadata files (.sfv, .nfo, .md5) are not archives themselves.
// If no archives were extracted (already done in a prior round) and no
// failures occurred, mark companions as extracted so they don't stay stuck.
entry.fullStatus = "Entpackt (Metadaten)";
}
// extracted === 0 && failed === 0: keep current status (no archives to process)
// extracted === 0 && failed === 0 for archive items: keep current status
entry.updatedAt = updatedAt;
}
}