Release v1.6.21
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
729aa30253
commit
1ed13f7f88
@@ -21,7 +21,7 @@ import { parseCollectorInput } from "./link-parser";
|
||||
import { configureLogger, getLogFilePath, logger } from "./logger";
|
||||
import { initSessionLog, getSessionLogPath, shutdownSessionLog } from "./session-log";
|
||||
import { MegaWebFallback } from "./mega-web-fallback";
|
||||
import { addHistoryEntry, clearHistory, createStoragePaths, loadHistory, loadSession, loadSettings, normalizeSettings, removeHistoryEntry, saveSession, saveSettings } from "./storage";
|
||||
import { addHistoryEntry, clearHistory, createStoragePaths, loadHistory, loadSession, loadSettings, normalizeLoadedSession, normalizeLoadedSessionTransientFields, normalizeSettings, removeHistoryEntry, saveSession, saveSettings } from "./storage";
|
||||
import { abortActiveUpdateDownload, checkGitHubUpdate, installLatestUpdate } from "./update";
|
||||
import { startDebugServer, stopDebugServer } from "./debug-server";
|
||||
|
||||
@@ -309,7 +309,9 @@ export class AppController {
|
||||
// Cancel any deferred persist timer so the old in-memory session
|
||||
// does not overwrite the restored session file on disk.
|
||||
this.manager.clearPersistTimer();
|
||||
const restoredSession = parsed.session as ReturnType<typeof loadSession>;
|
||||
const restoredSession = normalizeLoadedSessionTransientFields(
|
||||
normalizeLoadedSession(parsed.session)
|
||||
);
|
||||
saveSession(this.storagePaths, restoredSession);
|
||||
return { restored: true, message: "Backup wiederhergestellt. Bitte App neustarten." };
|
||||
}
|
||||
|
||||
@@ -2540,6 +2540,14 @@ export class DownloadManager extends EventEmitter {
|
||||
pkg.updatedAt = nowMs();
|
||||
this.historyRecordedPackages.delete(packageId);
|
||||
|
||||
// 5. Re-add to runItemIds/runPackageIds if session is running so outcomes are tracked
|
||||
if (this.session.running) {
|
||||
for (const itemId of itemIds) {
|
||||
this.runItemIds.add(itemId);
|
||||
}
|
||||
this.runPackageIds.add(packageId);
|
||||
}
|
||||
|
||||
logger.info(`Paket "${pkg.name}" zurückgesetzt (${itemIds.length} Items)`);
|
||||
this.persistSoon();
|
||||
this.emitState(true);
|
||||
|
||||
@@ -1993,6 +1993,7 @@ export async function extractPackageArchives(options: ExtractOptions): Promise<{
|
||||
const sig = await detectArchiveSignature(archivePath);
|
||||
if (!sig) {
|
||||
logger.info(`Generische Split-Datei übersprungen (keine Archiv-Signatur): ${archiveName}`);
|
||||
extracted += 1;
|
||||
clearInterval(pulseTimer);
|
||||
return;
|
||||
}
|
||||
@@ -2200,10 +2201,8 @@ export async function extractPackageArchives(options: ExtractOptions): Promise<{
|
||||
resumeCompleted.add(nestedKey);
|
||||
await writeExtractResumeState(options.packageDir, resumeCompleted, options.packageId);
|
||||
logger.info(`Nested-Entpacken erfolgreich: ${nestedName}`);
|
||||
if (options.cleanupMode === "delete") {
|
||||
for (const part of collectArchiveCleanupTargets(nestedArchive)) {
|
||||
try { await fs.promises.unlink(part); } catch { /* ignore */ }
|
||||
}
|
||||
if (options.cleanupMode !== "none") {
|
||||
await cleanupArchives([nestedArchive], options.cleanupMode);
|
||||
}
|
||||
} catch (nestedErr) {
|
||||
const errText = String(nestedErr);
|
||||
|
||||
+3
-4
@@ -188,8 +188,7 @@ function sanitizeCredentialPersistence(settings: AppSettings): AppSettings {
|
||||
megaLogin: "",
|
||||
megaPassword: "",
|
||||
bestToken: "",
|
||||
allDebridToken: "",
|
||||
archivePasswordList: ""
|
||||
allDebridToken: ""
|
||||
};
|
||||
}
|
||||
|
||||
@@ -233,7 +232,7 @@ function readSettingsFile(filePath: string): AppSettings | null {
|
||||
}
|
||||
}
|
||||
|
||||
function normalizeLoadedSession(raw: unknown): SessionState {
|
||||
export function normalizeLoadedSession(raw: unknown): SessionState {
|
||||
const fallback = emptySession();
|
||||
const parsed = asRecord(raw);
|
||||
if (!parsed) {
|
||||
@@ -412,7 +411,7 @@ function sessionBackupPath(sessionFile: string): string {
|
||||
return `${sessionFile}.bak`;
|
||||
}
|
||||
|
||||
function normalizeLoadedSessionTransientFields(session: SessionState): SessionState {
|
||||
export function normalizeLoadedSessionTransientFields(session: SessionState): SessionState {
|
||||
// Reset transient fields that may be stale from a previous crash
|
||||
const ACTIVE_STATUSES = new Set(["downloading", "validating", "extracting", "integrity_check", "paused", "reconnect_wait"]);
|
||||
for (const item of Object.values(session.items)) {
|
||||
|
||||
Reference in New Issue
Block a user