From 254612a49b4f257bbbaa168988921aea9306fefe Mon Sep 17 00:00:00 2001 From: Sucukdeluxe Date: Wed, 4 Mar 2026 03:04:49 +0100 Subject: [PATCH] Release v1.5.90 Co-Authored-By: Claude Opus 4.6 --- package.json | 2 +- src/main/download-manager.ts | 18 ++++++++++++++---- src/main/main.ts | 2 +- src/renderer/App.tsx | 4 +++- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index d94a06d..54ed2fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "real-debrid-downloader", - "version": "1.5.89", + "version": "1.5.90", "description": "Real-Debrid Downloader Desktop (Electron + React + TypeScript)", "main": "build/main/main/main.js", "author": "Sucukdeluxe", diff --git a/src/main/download-manager.ts b/src/main/download-manager.ts index 0548ccd..0ea4888 100644 --- a/src/main/download-manager.ts +++ b/src/main/download-manager.ts @@ -2544,10 +2544,10 @@ export class DownloadManager extends EventEmitter { public async startPackages(packageIds: string[]): Promise { const targetSet = new Set(packageIds); - // Enable specified packages if disabled + // Enable specified packages if disabled (only non-cancelled) for (const pkgId of targetSet) { const pkg = this.session.packages[pkgId]; - if (pkg && !pkg.enabled) { + if (pkg && !pkg.cancelled && !pkg.enabled) { pkg.enabled = true; } } @@ -2613,6 +2613,10 @@ export class DownloadManager extends EventEmitter { this.speedEventsHead = 0; this.lastGlobalProgressBytes = 0; this.lastGlobalProgressAt = nowMs(); + this.lastReconnectMarkAt = 0; + this.consecutiveReconnects = 0; + this.globalSpeedLimitQueue = Promise.resolve(); + this.globalSpeedLimitNextAt = 0; this.summary = null; this.nonResumableActive = 0; this.persistSoon(); @@ -2637,10 +2641,10 @@ export class DownloadManager extends EventEmitter { if (item) affectedPackageIds.add(item.packageId); } - // Enable affected packages if disabled + // Enable affected packages if disabled (only non-cancelled) for (const pkgId of affectedPackageIds) { const pkg = this.session.packages[pkgId]; - if (pkg && !pkg.enabled) { + if (pkg && !pkg.cancelled && !pkg.enabled) { pkg.enabled = true; } } @@ -2666,6 +2670,8 @@ export class DownloadManager extends EventEmitter { for (const itemId of targetSet) { const item = this.session.items[itemId]; if (!item) continue; + const pkg = this.session.packages[item.packageId]; + if (!pkg || pkg.cancelled || !pkg.enabled) continue; if (item.status === "queued" || item.status === "reconnect_wait") { this.runItemIds.add(item.id); this.runPackageIds.add(item.packageId); @@ -2708,6 +2714,10 @@ export class DownloadManager extends EventEmitter { this.speedEventsHead = 0; this.lastGlobalProgressBytes = 0; this.lastGlobalProgressAt = nowMs(); + this.lastReconnectMarkAt = 0; + this.consecutiveReconnects = 0; + this.globalSpeedLimitQueue = Promise.resolve(); + this.globalSpeedLimitNextAt = 0; this.summary = null; this.nonResumableActive = 0; this.persistSoon(); diff --git a/src/main/main.ts b/src/main/main.ts index f17fb24..9441e1e 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -293,7 +293,7 @@ function registerIpcHandlers(): void { return controller.startPackages(packageIds); }); ipcMain.handle(IPC_CHANNELS.START_ITEMS, (_event: IpcMainInvokeEvent, itemIds: string[]) => { - if (!Array.isArray(itemIds)) throw new Error("itemIds muss ein Array sein"); + validateStringArray(itemIds ?? [], "itemIds"); return controller.startItems(itemIds); }); ipcMain.handle(IPC_CHANNELS.STOP, () => controller.stop()); diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index 3c3f0df..ae23fc0 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -2830,10 +2830,12 @@ export function App(): ReactElement { {contextMenu && (() => { const multi = selectedIds.size > 1; const hasPackages = [...selectedIds].some((id) => snapshot.session.packages[id]); + const startableStatuses = new Set(["queued", "cancelled", "reconnect_wait"]); + const hasStartableItems = [...selectedIds].some((id) => { const it = snapshot.session.items[id]; return it && startableStatuses.has(it.status); }); const hasItems = [...selectedIds].some((id) => snapshot.session.items[id]); return (
e.stopPropagation()}> - {(hasPackages || hasItems) && ( + {(hasPackages || hasStartableItems) && (