Compare commits

...

2 Commits

Author SHA1 Message Date
Sucukdeluxe
7141579289 Release v1.6.95 2026-03-07 00:04:02 +01:00
Sucukdeluxe
dfc5d73105 Fix disk-fallback extraction triggering with incomplete archive parts
When a pending item has neither targetPath nor fileName (e.g. after a
reset before re-unrestrict), it is invisible to pendingItemStatus and
the disk-fallback could incorrectly start extraction with a partial file.
Add a guard that skips disk-fallback for any archive set if the package
contains such an untracked pending item.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 00:03:31 +01:00
2 changed files with 14 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "real-debrid-downloader",
"version": "1.6.94",
"version": "1.6.95",
"description": "Desktop downloader",
"main": "build/main/main/main.js",
"author": "Sucukdeluxe",

View File

@ -6747,6 +6747,19 @@ export class DownloadManager extends EventEmitter {
if (anyActivelyProcessing) {
continue;
}
// Safety: if any pending item in the package has neither targetPath nor fileName,
// we cannot map it to a file on disk. It could correspond to any missingPart
// (e.g. after a reset before re-unrestrict), so skip disk-fallback for this archive.
const hasUntrackedPendingItem = pkg.itemIds.some((itemId) => {
const pendingItem = this.session.items[itemId];
return pendingItem
&& !isFinishedStatus(pendingItem.status)
&& !pendingItem.targetPath
&& !pendingItem.fileName;
});
if (hasUntrackedPendingItem) {
continue;
}
logger.info(`Hybrid-Extract Disk-Fallback: ${path.basename(candidate)} (${missingParts.length} Part(s) auf Disk ohne completed-Status)`);
ready.add(pathKey(candidate));
}