Add Account Manager + fix Hybrid-Extract premature extraction

- Account Manager: table UI with add/remove/check for all 4 providers
  (Real-Debrid, Mega-Debrid, BestDebrid, AllDebrid)
- Backend: checkRealDebridAccount, checkAllDebridAccount, checkBestDebridAccount
- Hybrid-Extract fix: check item.fileName for queued items without targetPath,
  disable disk-fallback for multi-part archives, extend disk-fallback to catch
  active downloads by fileName match (prevents CRC errors on incomplete files)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sucukdeluxe
2026-03-03 14:36:13 +01:00
co-authored by Claude Opus 4.6
parent e6ec1ed755
commit 0b7c658c8f
6 changed files with 307 additions and 43 deletions
+11 -6
View File
@@ -499,7 +499,7 @@ function extractorThreadSwitch(hybridMode = false): string {
return `-mt${threadCount}`;
}
function lowerExtractProcessPriority(childPid: number | undefined): void {
function lowerExtractProcessPriority(childPid: number | undefined, label = ""): void {
if (process.platform !== "win32") {
return;
}
@@ -511,6 +511,9 @@ function lowerExtractProcessPriority(childPid: number | undefined): void {
// IDLE_PRIORITY_CLASS: lowers CPU scheduling priority so extraction
// doesn't starve other processes. I/O priority stays Normal (like JDownloader 2).
os.setPriority(pid, os.constants.priority.PRIORITY_LOW);
if (label) {
logger.info(`Prozess-Priorität: CPU=Idle, I/O=Normal (PID ${pid}, ${label})`);
}
} catch {
// ignore: priority lowering is best-effort
}
@@ -580,7 +583,7 @@ function runExtractCommand(
let settled = false;
let output = "";
const child = spawn(command, args, { windowsHide: true });
lowerExtractProcessPriority(child.pid);
lowerExtractProcessPriority(child.pid, `legacy/${path.basename(command).replace(/\.exe$/i, "")}`);
let timeoutId: NodeJS.Timeout | null = null;
let timedOutByWatchdog = false;
let abortedBySignal = false;
@@ -897,7 +900,7 @@ function runJvmExtractCommand(
let stderrBuffer = "";
const child = spawn(layout.javaCommand, args, { windowsHide: true });
lowerExtractProcessPriority(child.pid);
lowerExtractProcessPriority(child.pid, "7zjbinding/single-thread");
const flushLines = (rawChunk: string, fromStdErr = false): void => {
if (!rawChunk) {
@@ -1179,7 +1182,7 @@ async function runExternalExtract(
);
if (jvmResult.ok) {
logger.info(`Entpackt via ${jvmResult.backend || "jvm"}: ${path.basename(archivePath)}`);
logger.info(`Entpackt via ${jvmResult.backend || "jvm"} [CPU=Idle, I/O=Normal, single-thread]: ${path.basename(archivePath)}`);
return jvmResult.usedPassword;
}
if (jvmResult.aborted) {
@@ -1219,10 +1222,12 @@ async function runExternalExtract(
hybridMode
);
const extractorName = path.basename(command).replace(/\.exe$/i, "");
const threadInfo = extractorThreadSwitch(hybridMode);
const modeLabel = hybridMode ? "hybrid" : "normal";
if (jvmFailureReason) {
logger.info(`Entpackt via legacy/${extractorName} (nach JVM-Fehler): ${path.basename(archivePath)}`);
logger.info(`Entpackt via legacy/${extractorName} [CPU=Idle, I/O=Normal, ${threadInfo}, ${modeLabel}] (nach JVM-Fehler): ${path.basename(archivePath)}`);
} else {
logger.info(`Entpackt via legacy/${extractorName}: ${path.basename(archivePath)}`);
logger.info(`Entpackt via legacy/${extractorName} [CPU=Idle, I/O=Normal, ${threadInfo}, ${modeLabel}]: ${path.basename(archivePath)}`);
}
return password;
} finally {