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",
|
"name": "real-debrid-downloader",
|
||||||
"version": "1.3.3",
|
"version": "1.3.4",
|
||||||
"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",
|
||||||
|
|||||||
@ -168,11 +168,13 @@ export class DownloadManager extends EventEmitter {
|
|||||||
this.applyOnStartCleanupPolicy();
|
this.applyOnStartCleanupPolicy();
|
||||||
this.normalizeSessionStatuses();
|
this.normalizeSessionStatuses();
|
||||||
this.recoverPostProcessingOnStartup();
|
this.recoverPostProcessingOnStartup();
|
||||||
|
this.resolveExistingQueuedOpaqueFilenames();
|
||||||
}
|
}
|
||||||
|
|
||||||
public setSettings(next: AppSettings): void {
|
public setSettings(next: AppSettings): void {
|
||||||
this.settings = next;
|
this.settings = next;
|
||||||
this.debridService.setSettings(next);
|
this.debridService.setSettings(next);
|
||||||
|
this.resolveExistingQueuedOpaqueFilenames();
|
||||||
this.emitState();
|
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 {
|
public cancelPackage(packageId: string): void {
|
||||||
const pkg = this.session.packages[packageId];
|
const pkg = this.session.packages[packageId];
|
||||||
if (!pkg) {
|
if (!pkg) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user