Show live extraction progress in package postProcessLabel

Update postProcessLabel during extraction with detailed progress:
- Overall percentage and archive count (e.g. "Entpacken 45% (3/6)")
- Password cracking progress when testing passwords
- Works for both hybrid and full extraction modes

Previously the label was static "Entpacken..." with no detail about
what was happening during potentially long extraction phases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sucukdeluxe 2026-03-05 02:46:10 +01:00
parent 8f66d75eb3
commit 8839080069
2 changed files with 15 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "real-debrid-downloader", "name": "real-debrid-downloader",
"version": "1.6.40", "version": "1.6.41",
"description": "Desktop downloader", "description": "Desktop downloader",
"main": "build/main/main/main.js", "main": "build/main/main/main.js",
"author": "Sucukdeluxe", "author": "Sucukdeluxe",

View File

@ -6433,6 +6433,18 @@ export class DownloadManager extends EventEmitter {
} }
} }
// Update package-level label with overall extraction progress
const activeArchive = Number(progress.archivePercent ?? 0) > 0 ? 1 : 0;
const currentDisplay = Math.max(0, Math.min(progress.total, progress.current + activeArchive));
if (progress.passwordFound) {
pkg.postProcessLabel = `Passwort gefunden · ${progress.archiveName || ""}`;
} else if (progress.passwordAttempt && progress.passwordTotal && progress.passwordTotal > 1) {
const pwPct = Math.round((progress.passwordAttempt / progress.passwordTotal) * 100);
pkg.postProcessLabel = `Passwort knacken: ${pwPct}%`;
} else {
pkg.postProcessLabel = `Entpacken ${progress.percent}% (${currentDisplay}/${progress.total})`;
}
// Throttled emit — also promote "Warten auf Parts" items that // Throttled emit — also promote "Warten auf Parts" items that
// completed downloading in the meantime to "Ausstehend". // completed downloading in the meantime to "Ausstehend".
const now = nowMs(); const now = nowMs();
@ -6609,12 +6621,13 @@ export class DownloadManager extends EventEmitter {
resolveArchiveItemsFromList(archiveName, completedItems); resolveArchiveItemsFromList(archiveName, completedItems);
let lastExtractEmitAt = 0; let lastExtractEmitAt = 0;
const emitExtractStatus = (_text: string, force = false): void => { const emitExtractStatus = (text: string, force = false): void => {
const now = nowMs(); const now = nowMs();
if (!force && now - lastExtractEmitAt < EXTRACT_PROGRESS_EMIT_INTERVAL_MS) { if (!force && now - lastExtractEmitAt < EXTRACT_PROGRESS_EMIT_INTERVAL_MS) {
return; return;
} }
lastExtractEmitAt = now; lastExtractEmitAt = now;
pkg.postProcessLabel = text || "Entpacken...";
this.emitState(); this.emitState();
}; };