Compare commits
2 Commits
8870a3aeca
...
30dbbbae9e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30dbbbae9e | ||
|
|
98dc36648c |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "real-debrid-downloader",
|
"name": "real-debrid-downloader",
|
||||||
"version": "1.7.161",
|
"version": "1.7.162",
|
||||||
"description": "Desktop downloader",
|
"description": "Desktop downloader",
|
||||||
"main": "build/main/main/main.js",
|
"main": "build/main/main/main.js",
|
||||||
"author": "Sucukdeluxe",
|
"author": "Sucukdeluxe",
|
||||||
|
|||||||
@ -51,6 +51,27 @@ 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");
|
||||||
@ -164,10 +185,16 @@ 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");
|
||||||
addDirectoryIfExists(zip, path.join(baseDir, "package-logs"), "logs/package-logs");
|
addRecentDirectoryFiles(zip, path.join(baseDir, "package-logs"), "logs/package-logs", SUPPORT_BUNDLE_LOG_WINDOW_MS);
|
||||||
addDirectoryIfExists(zip, path.join(baseDir, "item-logs"), "logs/item-logs");
|
addRecentDirectoryFiles(zip, path.join(baseDir, "item-logs"), "logs/item-logs", SUPPORT_BUNDLE_LOG_WINDOW_MS);
|
||||||
|
|
||||||
|
// 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