Release v1.5.76
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0c058fa162
commit
83d8df84bf
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "real-debrid-downloader",
|
"name": "real-debrid-downloader",
|
||||||
"version": "1.5.75",
|
"version": "1.5.76",
|
||||||
"description": "Real-Debrid Downloader Desktop (Electron + React + TypeScript)",
|
"description": "Real-Debrid Downloader Desktop (Electron + React + TypeScript)",
|
||||||
"main": "build/main/main/main.js",
|
"main": "build/main/main/main.js",
|
||||||
"author": "Sucukdeluxe",
|
"author": "Sucukdeluxe",
|
||||||
|
|||||||
@ -3597,10 +3597,8 @@ export class DownloadManager extends EventEmitter {
|
|||||||
this.lastReconnectMarkAt = 0;
|
this.lastReconnectMarkAt = 0;
|
||||||
|
|
||||||
for (const active of this.activeTasks.values()) {
|
for (const active of this.activeTasks.values()) {
|
||||||
if (active.resumable) {
|
active.abortReason = "reconnect";
|
||||||
active.abortReason = "reconnect";
|
active.abortController.abort("reconnect");
|
||||||
active.abortController.abort("reconnect");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.warn(`Reconnect angefordert: ${reason} (consecutive=${this.consecutiveReconnects}, wait=${Math.ceil(cappedWaitMs / 1000)}s)`);
|
logger.warn(`Reconnect angefordert: ${reason} (consecutive=${this.consecutiveReconnects}, wait=${Math.ceil(cappedWaitMs / 1000)}s)`);
|
||||||
@ -4332,20 +4330,17 @@ export class DownloadManager extends EventEmitter {
|
|||||||
let response: Response;
|
let response: Response;
|
||||||
const connectTimeoutMs = getDownloadConnectTimeoutMs();
|
const connectTimeoutMs = getDownloadConnectTimeoutMs();
|
||||||
let connectTimer: NodeJS.Timeout | null = null;
|
let connectTimer: NodeJS.Timeout | null = null;
|
||||||
|
const connectAbortController = new AbortController();
|
||||||
try {
|
try {
|
||||||
if (connectTimeoutMs > 0) {
|
if (connectTimeoutMs > 0) {
|
||||||
connectTimer = setTimeout(() => {
|
connectTimer = setTimeout(() => {
|
||||||
if (active.abortController.signal.aborted) {
|
connectAbortController.abort("connect_timeout");
|
||||||
return;
|
|
||||||
}
|
|
||||||
active.abortReason = "stall";
|
|
||||||
active.abortController.abort("stall");
|
|
||||||
}, connectTimeoutMs);
|
}, connectTimeoutMs);
|
||||||
}
|
}
|
||||||
response = await fetch(directUrl, {
|
response = await fetch(directUrl, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers,
|
headers,
|
||||||
signal: active.abortController.signal
|
signal: AbortSignal.any([active.abortController.signal, connectAbortController.signal])
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (active.abortController.signal.aborted || String(error).includes("aborted:")) {
|
if (active.abortController.signal.aborted || String(error).includes("aborted:")) {
|
||||||
@ -4687,7 +4682,7 @@ export class DownloadManager extends EventEmitter {
|
|||||||
if (active.abortController.signal.aborted) {
|
if (active.abortController.signal.aborted) {
|
||||||
throw new Error(`aborted:${active.abortReason}`);
|
throw new Error(`aborted:${active.abortReason}`);
|
||||||
}
|
}
|
||||||
if (this.reconnectActive() && active.resumable) {
|
if (this.reconnectActive()) {
|
||||||
active.abortReason = "reconnect";
|
active.abortReason = "reconnect";
|
||||||
active.abortController.abort("reconnect");
|
active.abortController.abort("reconnect");
|
||||||
throw new Error("aborted:reconnect");
|
throw new Error("aborted:reconnect");
|
||||||
@ -4990,7 +4985,7 @@ export class DownloadManager extends EventEmitter {
|
|||||||
if (failed > 0) {
|
if (failed > 0) {
|
||||||
pkg.status = "failed";
|
pkg.status = "failed";
|
||||||
} else if (cancelled > 0) {
|
} else if (cancelled > 0) {
|
||||||
pkg.status = success > 0 ? "failed" : "cancelled";
|
pkg.status = success > 0 ? "completed" : "cancelled";
|
||||||
} else if (success > 0) {
|
} else if (success > 0) {
|
||||||
pkg.status = "completed";
|
pkg.status = "completed";
|
||||||
}
|
}
|
||||||
@ -5014,13 +5009,17 @@ export class DownloadManager extends EventEmitter {
|
|||||||
const schedules = this.settings.bandwidthSchedules;
|
const schedules = this.settings.bandwidthSchedules;
|
||||||
if (schedules.length > 0) {
|
if (schedules.length > 0) {
|
||||||
const hour = new Date().getHours();
|
const hour = new Date().getHours();
|
||||||
|
let allDayLimit: number | null = null;
|
||||||
for (const entry of schedules) {
|
for (const entry of schedules) {
|
||||||
if (!entry.enabled) {
|
if (!entry.enabled) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (entry.startHour === entry.endHour) {
|
if (entry.startHour === entry.endHour) {
|
||||||
this.cachedSpeedLimitKbps = entry.speedLimitKbps;
|
// "All day" schedule — use as fallback, don't block more specific schedules
|
||||||
return this.cachedSpeedLimitKbps;
|
if (allDayLimit === null) {
|
||||||
|
allDayLimit = entry.speedLimitKbps;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
const wraps = entry.startHour > entry.endHour;
|
const wraps = entry.startHour > entry.endHour;
|
||||||
const inRange = wraps
|
const inRange = wraps
|
||||||
@ -5031,6 +5030,10 @@ export class DownloadManager extends EventEmitter {
|
|||||||
return this.cachedSpeedLimitKbps;
|
return this.cachedSpeedLimitKbps;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (allDayLimit !== null) {
|
||||||
|
this.cachedSpeedLimitKbps = allDayLimit;
|
||||||
|
return this.cachedSpeedLimitKbps;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (this.settings.speedLimitEnabled && this.settings.speedLimitKbps > 0) {
|
if (this.settings.speedLimitEnabled && this.settings.speedLimitKbps > 0) {
|
||||||
this.cachedSpeedLimitKbps = this.settings.speedLimitKbps;
|
this.cachedSpeedLimitKbps = this.settings.speedLimitKbps;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user