Compare commits
No commits in common. "4df0d40ece461daf0b59e18e1a8741ad6e844e2c" and "ab08506361af83d7f951dbee1da57289c38e621d" have entirely different histories.
4df0d40ece
...
ab08506361
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "real-debrid-downloader-beta",
|
"name": "real-debrid-downloader-beta",
|
||||||
"version": "2.0.0-beta.3",
|
"version": "2.0.0-beta.2",
|
||||||
"description": "Desktop downloader",
|
"description": "Desktop downloader",
|
||||||
"main": "build/main/main/main.js",
|
"main": "build/main/main/main.js",
|
||||||
"author": "Sucukdeluxe",
|
"author": "Sucukdeluxe",
|
||||||
|
|||||||
@ -523,37 +523,23 @@ export class DownloadManager extends EventEmitter {
|
|||||||
pkg.cancelled = true;
|
pkg.cancelled = true;
|
||||||
pkg.status = "cancelled";
|
pkg.status = "cancelled";
|
||||||
pkg.updatedAt = nowMs();
|
pkg.updatedAt = nowMs();
|
||||||
const outputDir = pkg.outputDir;
|
for (const itemId of pkg.itemIds) {
|
||||||
const itemIds = [...pkg.itemIds];
|
|
||||||
|
|
||||||
for (const itemId of itemIds) {
|
|
||||||
const item = this.session.items[itemId];
|
const item = this.session.items[itemId];
|
||||||
if (!item) continue;
|
if (!item) continue;
|
||||||
const slot = this.activeTasks.get(itemId);
|
const slot = this.activeTasks.get(itemId);
|
||||||
if (slot) { slot.abortReason = "cancel"; slot.abortController.abort("cancel"); }
|
if (slot) { slot.abortReason = "cancel"; slot.abortController.abort("cancel"); }
|
||||||
if (item.status !== "completed") {
|
if (!isFinishedStatus(item.status)) {
|
||||||
this.runOutcomes.set(itemId, "cancelled");
|
item.status = "cancelled";
|
||||||
|
item.fullStatus = "Abgebrochen";
|
||||||
|
item.speedBps = 0;
|
||||||
|
item.updatedAt = nowMs();
|
||||||
}
|
}
|
||||||
this.releaseTargetPath(itemId);
|
this.releaseTargetPath(itemId);
|
||||||
this.retryManager.removeItem(itemId);
|
this.retryManager.removeItem(itemId);
|
||||||
this.cachedDirectUrls.delete(itemId);
|
|
||||||
this.itemContributedBytes.delete(itemId);
|
|
||||||
delete this.session.items[itemId];
|
|
||||||
this.itemCount = Math.max(0, this.itemCount - 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.postProcessor.abortPackage(packageId);
|
this.postProcessor.abortPackage(packageId);
|
||||||
this.historyRecordedPackages.delete(packageId);
|
|
||||||
this.hybridExtractRequeue.delete(packageId);
|
|
||||||
this.packagePostProcessTasks.delete(packageId);
|
|
||||||
delete this.session.packages[packageId];
|
|
||||||
this.session.packageOrder = this.session.packageOrder.filter(id => id !== packageId);
|
|
||||||
|
|
||||||
this.persistSoon();
|
this.persistSoon();
|
||||||
this.emitState();
|
this.emitState();
|
||||||
|
|
||||||
// Cleanup artifacts in background
|
|
||||||
void cleanupCancelledPackageArtifactsAsync(outputDir).catch(() => {});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public resetPackage(packageId: string): void {
|
public resetPackage(packageId: string): void {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user