Fix download freeze spikes and unrestrict slot overshoot handling

This commit is contained in:
Sucukdeluxe
2026-03-02 23:47:54 +01:00
parent 7fe7d93e83
commit 19342647e5
10 changed files with 230 additions and 38 deletions
+4 -1
View File
@@ -33,5 +33,8 @@ export const IPC_CHANNELS = {
IMPORT_BACKUP: "app:import-backup",
OPEN_LOG: "app:open-log",
RETRY_EXTRACTION: "queue:retry-extraction",
EXTRACT_NOW: "queue:extract-now"
EXTRACT_NOW: "queue:extract-now",
GET_HISTORY: "history:get",
CLEAR_HISTORY: "history:clear",
REMOVE_HISTORY_ENTRY: "history:remove-entry"
} as const;
+4
View File
@@ -2,6 +2,7 @@ import type {
AddLinksPayload,
AppSettings,
DuplicatePolicy,
HistoryEntry,
SessionStats,
StartConflictEntry,
StartConflictResolutionResult,
@@ -44,6 +45,9 @@ export interface ElectronApi {
openLog: () => Promise<void>;
retryExtraction: (packageId: string) => Promise<void>;
extractNow: (packageId: string) => Promise<void>;
getHistory: () => Promise<HistoryEntry[]>;
clearHistory: () => Promise<void>;
removeHistoryEntry: (entryId: string) => Promise<void>;
onStateUpdate: (callback: (snapshot: UiSnapshot) => void) => () => void;
onClipboardDetected: (callback: (links: string[]) => void) => () => void;
onUpdateInstallProgress: (callback: (progress: UpdateInstallProgress) => void) => () => void;
+18
View File
@@ -255,3 +255,21 @@ export interface SessionStats {
activeDownloads: number;
queuedDownloads: number;
}
export interface HistoryEntry {
id: string;
name: string;
totalBytes: number;
downloadedBytes: number;
fileCount: number;
provider: DebridProvider | null;
completedAt: number;
durationSeconds: number;
status: "completed" | "deleted";
outputDir: string;
}
export interface HistoryState {
entries: HistoryEntry[];
maxEntries: number;
}