Rescan queued hash names on startup and release v1.3.4
This commit is contained in:
parent
6fe7b7e7ee
commit
973885a147
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "real-debrid-downloader",
|
||||
"version": "1.3.3",
|
||||
"version": "1.3.4",
|
||||
"description": "Real-Debrid Downloader Desktop (Electron + React + TypeScript)",
|
||||
"main": "build/main/main/main.js",
|
||||
"author": "Sucukdeluxe",
|
||||
|
||||
@ -168,11 +168,13 @@ export class DownloadManager extends EventEmitter {
|
||||
this.applyOnStartCleanupPolicy();
|
||||
this.normalizeSessionStatuses();
|
||||
this.recoverPostProcessingOnStartup();
|
||||
this.resolveExistingQueuedOpaqueFilenames();
|
||||
}
|
||||
|
||||
public setSettings(next: AppSettings): void {
|
||||
this.settings = next;
|
||||
this.debridService.setSettings(next);
|
||||
this.resolveExistingQueuedOpaqueFilenames();
|
||||
this.emitState();
|
||||
}
|
||||
|
||||
@ -538,6 +540,29 @@ export class DownloadManager extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
private resolveExistingQueuedOpaqueFilenames(): void {
|
||||
const unresolvedByLink = new Map<string, string[]>();
|
||||
for (const item of Object.values(this.session.items)) {
|
||||
if (!looksLikeOpaqueFilename(item.fileName)) {
|
||||
continue;
|
||||
}
|
||||
if (item.status !== "queued" && item.status !== "reconnect_wait") {
|
||||
continue;
|
||||
}
|
||||
const pkg = this.session.packages[item.packageId];
|
||||
if (!pkg || pkg.cancelled) {
|
||||
continue;
|
||||
}
|
||||
const existing = unresolvedByLink.get(item.url) ?? [];
|
||||
existing.push(item.id);
|
||||
unresolvedByLink.set(item.url, existing);
|
||||
}
|
||||
|
||||
if (unresolvedByLink.size > 0) {
|
||||
void this.resolveQueuedFilenames(unresolvedByLink);
|
||||
}
|
||||
}
|
||||
|
||||
public cancelPackage(packageId: string): void {
|
||||
const pkg = this.session.packages[packageId];
|
||||
if (!pkg) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user