Improve rename and extractor diagnostics
This commit is contained in:
@@ -2682,6 +2682,13 @@ export class DownloadManager extends EventEmitter {
|
||||
forceEpisodeForSeasonFolder: true
|
||||
});
|
||||
if (!targetBaseName) {
|
||||
if (pkg) {
|
||||
this.logPackageForPackage(pkg, "WARN", "Auto-Rename übersprungen: kein Zielname", {
|
||||
sourceName,
|
||||
sourceBaseName,
|
||||
folders: folderCandidates.join(", ")
|
||||
});
|
||||
}
|
||||
logger.info(`Auto-Rename: kein Zielname für ${sourceName} (folders=${folderCandidates.join(", ")})`);
|
||||
continue;
|
||||
}
|
||||
@@ -2706,6 +2713,13 @@ export class DownloadManager extends EventEmitter {
|
||||
}
|
||||
}
|
||||
if (!targetPath) {
|
||||
if (pkg) {
|
||||
this.logPackageForPackage(pkg, "WARN", "Auto-Rename übersprungen: Zielpfad ungültig", {
|
||||
sourceName,
|
||||
sourceBaseName,
|
||||
targetBaseName
|
||||
});
|
||||
}
|
||||
logger.warn(`Auto-Rename übersprungen (Zielpfad zu lang/ungültig): ${sourcePath}`);
|
||||
continue;
|
||||
}
|
||||
@@ -2713,6 +2727,12 @@ export class DownloadManager extends EventEmitter {
|
||||
continue;
|
||||
}
|
||||
if (await this.existsAsync(targetPath)) {
|
||||
if (pkg) {
|
||||
this.logPackageForPackage(pkg, "WARN", "Auto-Rename übersprungen: Ziel existiert", {
|
||||
sourceName,
|
||||
targetPath
|
||||
});
|
||||
}
|
||||
logger.warn(`Auto-Rename übersprungen (Ziel existiert): ${targetPath}`);
|
||||
continue;
|
||||
}
|
||||
@@ -2758,6 +2778,12 @@ export class DownloadManager extends EventEmitter {
|
||||
}
|
||||
}
|
||||
logger.warn(`Auto-Rename fehlgeschlagen (${sourceName}): ${compactErrorText(error)}`);
|
||||
if (pkg) {
|
||||
this.logPackageForPackage(pkg, "WARN", "Auto-Rename fehlgeschlagen", {
|
||||
sourceName,
|
||||
error: compactErrorText(error)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -457,8 +457,14 @@ function effectiveConflictMode(conflictMode: ConflictMode): "overwrite" | "skip"
|
||||
return "skip";
|
||||
}
|
||||
|
||||
function cleanErrorText(text: string): string {
|
||||
return String(text || "").replace(/\s+/g, " ").trim().slice(0, 500);
|
||||
export function cleanErrorText(text: string): string {
|
||||
const normalized = String(text || "").replace(/\s+/g, " ").trim();
|
||||
if (normalized.length <= 500) {
|
||||
return normalized;
|
||||
}
|
||||
const head = normalized.slice(0, 240).trimEnd();
|
||||
const tail = normalized.slice(-240).trimStart();
|
||||
return `${head} ... ${tail}`;
|
||||
}
|
||||
|
||||
function appendLimited(base: string, chunk: string, maxLen = MAX_EXTRACT_OUTPUT_BUFFER): string {
|
||||
@@ -2342,7 +2348,7 @@ async function runExternalExtractInner(
|
||||
let bestPercent = 0;
|
||||
let passwordAttempt = 0;
|
||||
let usePerformanceFlags = externalExtractorSupportsPerfFlags && shouldUseExtractorPerformanceFlags();
|
||||
const summarizeResultError = (errorText: string): string => cleanErrorText(errorText).slice(0, 280);
|
||||
const summarizeResultError = (errorText: string): string => cleanErrorText(errorText);
|
||||
let createErrorText = "";
|
||||
let createErrorPassword = "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user