Compare commits
No commits in common. "30dbbbae9e51df9a9a44b72505e0b2dd6d809335" and "8870a3aeca8f1e27e3190b667e88b6e1ce7eb3e7" have entirely different histories.
30dbbbae9e
...
8870a3aeca
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "real-debrid-downloader",
|
"name": "real-debrid-downloader",
|
||||||
"version": "1.7.162",
|
"version": "1.7.161",
|
||||||
"description": "Desktop downloader",
|
"description": "Desktop downloader",
|
||||||
"main": "build/main/main/main.js",
|
"main": "build/main/main/main.js",
|
||||||
"author": "Sucukdeluxe",
|
"author": "Sucukdeluxe",
|
||||||
|
|||||||
@ -51,27 +51,6 @@ function addDirectoryIfExists(zip: AdmZip, dirPath: string, zipRoot: string): vo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Wie addDirectoryIfExists, aber nur Dateien die in den letzten maxAgeMs ms geaendert wurden. */
|
|
||||||
function addRecentDirectoryFiles(zip: AdmZip, dirPath: string, zipRoot: string, maxAgeMs: number): number {
|
|
||||||
if (!fs.existsSync(dirPath)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
const cutoff = Date.now() - maxAgeMs;
|
|
||||||
let added = 0;
|
|
||||||
const entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
||||||
for (const entry of entries) {
|
|
||||||
if (!entry.isFile()) continue;
|
|
||||||
const fullPath = path.join(dirPath, entry.name);
|
|
||||||
try {
|
|
||||||
if (fs.statSync(fullPath).mtimeMs >= cutoff) {
|
|
||||||
zip.addLocalFile(fullPath, zipRoot, entry.name);
|
|
||||||
added += 1;
|
|
||||||
}
|
|
||||||
} catch { /* ignorieren */ }
|
|
||||||
}
|
|
||||||
return added;
|
|
||||||
}
|
|
||||||
|
|
||||||
function formatTimestampForFileName(date: Date): string {
|
function formatTimestampForFileName(date: Date): string {
|
||||||
const y = date.getFullYear();
|
const y = date.getFullYear();
|
||||||
const mo = String(date.getMonth() + 1).padStart(2, "0");
|
const mo = String(date.getMonth() + 1).padStart(2, "0");
|
||||||
@ -185,16 +164,10 @@ export function buildSupportBundle(manager: DownloadManager, baseDir: string, op
|
|||||||
addFileIfExists(zip, getTraceLogPath(), "logs/trace.log");
|
addFileIfExists(zip, getTraceLogPath(), "logs/trace.log");
|
||||||
addFileIfExists(zip, getTraceLogPath() ? `${getTraceLogPath()}.old` : null, "logs/trace.log.old");
|
addFileIfExists(zip, getTraceLogPath() ? `${getTraceLogPath()}.old` : null, "logs/trace.log.old");
|
||||||
|
|
||||||
// Granulare Per-Item/-Package/-Session-Logs nur der letzten 8h.
|
|
||||||
// Vorher wurden alle logs-Unterordner rekursiv gepackt → tausende Item-Logs
|
|
||||||
// → 200+ MB, unhandlich zum Verschicken. Mit 8h-Fenster bleibt das Bundle
|
|
||||||
// klein genug und enthaelt alles fuer aktuelle Fehler + Rename-Probleme.
|
|
||||||
const SUPPORT_BUNDLE_LOG_WINDOW_MS = 8 * 60 * 60 * 1000;
|
|
||||||
addDirectoryIfExists(zip, path.join(baseDir, "session-logs"), "logs/session-logs");
|
addDirectoryIfExists(zip, path.join(baseDir, "session-logs"), "logs/session-logs");
|
||||||
addRecentDirectoryFiles(zip, path.join(baseDir, "package-logs"), "logs/package-logs", SUPPORT_BUNDLE_LOG_WINDOW_MS);
|
addDirectoryIfExists(zip, path.join(baseDir, "package-logs"), "logs/package-logs");
|
||||||
addRecentDirectoryFiles(zip, path.join(baseDir, "item-logs"), "logs/item-logs", SUPPORT_BUNDLE_LOG_WINDOW_MS);
|
addDirectoryIfExists(zip, path.join(baseDir, "item-logs"), "logs/item-logs");
|
||||||
|
|
||||||
// Live-Logs der aktiven Queue (aktuelle Session) immer vollstaendig mitsichern.
|
|
||||||
for (const packageId of packageIds) {
|
for (const packageId of packageIds) {
|
||||||
addFileIfExists(zip, manager.getPackageLogPath(packageId) || getPackageLogPath(packageId), `logs/live/package-${packageId}.txt`);
|
addFileIfExists(zip, manager.getPackageLogPath(packageId) || getPackageLogPath(packageId), `logs/live/package-${packageId}.txt`);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user