Compare commits
No commits in common. "7d09479b44066dc2b659b7a18e4f021da34648c3" and "99074464fbc5ead732a6242407cc52684f708298" have entirely different histories.
7d09479b44
...
99074464fb
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "real-debrid-downloader",
|
||||
"version": "1.7.22",
|
||||
"version": "1.7.21",
|
||||
"description": "Desktop downloader",
|
||||
"main": "build/main/main/main.js",
|
||||
"author": "Sucukdeluxe",
|
||||
|
||||
@ -7365,11 +7365,10 @@ export class DownloadManager extends EventEmitter {
|
||||
}
|
||||
try {
|
||||
const stat = await fs.promises.stat(item.targetPath);
|
||||
// Require file to be essentially complete — within one allocation unit of the
|
||||
// expected size. The old 50% threshold incorrectly recovered partial downloads
|
||||
// (e.g. 627 MB of 1001 MB) and triggered hybrid extraction on incomplete archives.
|
||||
// Require file to be either ≥50% of expected size or at least 10 KB to avoid
|
||||
// recovering tiny error-response files (e.g. 9-byte "Forbidden" pages).
|
||||
const minSize = item.totalBytes && item.totalBytes > 0
|
||||
? Math.max(10240, item.totalBytes - ALLOCATION_UNIT_SIZE)
|
||||
? Math.max(10240, Math.floor(item.totalBytes * 0.5))
|
||||
: 10240;
|
||||
if (stat.size >= minSize) {
|
||||
// Re-check: another task may have started this item during the await
|
||||
@ -7377,14 +7376,6 @@ export class DownloadManager extends EventEmitter {
|
||||
|| item.status === "validating" || item.status === "integrity_check") {
|
||||
continue;
|
||||
}
|
||||
// Guard against pre-allocated sparse files from a hard crash: file has
|
||||
// the full expected size but downloadedBytes is significantly behind.
|
||||
if (item.downloadedBytes > 0 && item.totalBytes && item.totalBytes > 0
|
||||
&& stat.size >= item.totalBytes - ALLOCATION_UNIT_SIZE
|
||||
&& item.downloadedBytes < item.totalBytes * 0.95) {
|
||||
logger.warn(`Item-Recovery: ${item.fileName} uebersprungen – vermutlich pre-alloc (stat=${humanSize(stat.size)}, bytes=${humanSize(item.downloadedBytes)}, total=${humanSize(item.totalBytes)})`);
|
||||
continue;
|
||||
}
|
||||
logger.info(`Item-Recovery: ${item.fileName} war "${item.status}" aber Datei existiert (${humanSize(stat.size)}), setze auf completed`);
|
||||
item.status = "completed";
|
||||
item.fullStatus = this.settings.autoExtract ? "Entpacken - Ausstehend" : `Fertig (${humanSize(stat.size)})`;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user