Compare commits
No commits in common. "3ab7b6c9a3a5e705a187b5fd9ab95286882263dc" and "2a429b49c00c7f28b9fba001ce71afcb25d24db1" have entirely different histories.
3ab7b6c9a3
...
2a429b49c0
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "real-debrid-downloader",
|
"name": "real-debrid-downloader",
|
||||||
"version": "1.7.33",
|
"version": "1.7.32",
|
||||||
"description": "Desktop downloader",
|
"description": "Desktop downloader",
|
||||||
"main": "build/main/main/main.js",
|
"main": "build/main/main/main.js",
|
||||||
"author": "Sucukdeluxe",
|
"author": "Sucukdeluxe",
|
||||||
|
|||||||
@ -4226,21 +4226,12 @@ export class DownloadManager extends EventEmitter {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const inspectedArchiveItems = archiveItems
|
const corruptArchiveItems = archiveItems
|
||||||
.map((item) => ({ item, state: inspectPackageItemDiskState(pkg, item) }));
|
.map((item) => ({ item, state: inspectPackageItemDiskState(pkg, item) }))
|
||||||
const corruptArchiveItems = inspectedArchiveItems
|
|
||||||
.filter(({ state }) => state.reason !== "ok");
|
.filter(({ state }) => state.reason !== "ok");
|
||||||
|
|
||||||
if (corruptArchiveItems.length === 0) {
|
if (corruptArchiveItems.length === 0) {
|
||||||
// The extractor confirmed corruption (CRC error) but all files look
|
logger.warn(`Auto-Recovery (${scope}): ${failure.archiveName} uebersprungen - kein lokaler Dateifehler nachweisbar`);
|
||||||
// correct by size. This happens when content is corrupt despite having
|
return 0;
|
||||||
// the right byte count (e.g. network corruption during download).
|
|
||||||
// Trust the extractor verdict and force re-download of ALL archive parts.
|
|
||||||
logger.warn(
|
|
||||||
`Auto-Recovery (${scope}): ${failure.archiveName} - Dateien korrekte Groesse aber Extractor meldet CRC-Fehler, ` +
|
|
||||||
`erzwinge Re-Download aller ${archiveItems.length} Parts`
|
|
||||||
);
|
|
||||||
corruptArchiveItems.push(...inspectedArchiveItems);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const queuedAt = nowMs();
|
const queuedAt = nowMs();
|
||||||
@ -7823,21 +7814,7 @@ export class DownloadManager extends EventEmitter {
|
|||||||
item.updatedAt = nowMs();
|
item.updatedAt = nowMs();
|
||||||
this.recordRunOutcome(item.id, "completed");
|
this.recordRunOutcome(item.id, "completed");
|
||||||
} else if (stat.size > 0) {
|
} else if (stat.size > 0) {
|
||||||
// File exists but is clearly incomplete — delete and re-queue for download.
|
logger.warn(`Item-Recovery: ${item.fileName} übersprungen – Datei zu klein (${humanSize(stat.size)}, erwartet mind. ${humanSize(minSize)})`);
|
||||||
logger.warn(`Item-Recovery: ${item.fileName} unvollstaendig (${humanSize(stat.size)}, erwartet mind. ${humanSize(minSize)}), loesche und re-queue`);
|
|
||||||
try {
|
|
||||||
fs.rmSync(item.targetPath, { force: true });
|
|
||||||
} catch { /* ignore */ }
|
|
||||||
this.releaseTargetPath(item.id);
|
|
||||||
this.dropItemContribution(item.id);
|
|
||||||
item.targetPath = "";
|
|
||||||
item.status = "queued";
|
|
||||||
item.attempts = 0;
|
|
||||||
item.downloadedBytes = 0;
|
|
||||||
item.progressPercent = 0;
|
|
||||||
item.speedBps = 0;
|
|
||||||
item.fullStatus = "Wartet (unvollständiger Download)";
|
|
||||||
item.updatedAt = nowMs();
|
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
// file doesn't exist, nothing to recover
|
// file doesn't exist, nothing to recover
|
||||||
|
|||||||
@ -2042,7 +2042,7 @@ describe("download manager", () => {
|
|||||||
expect(session.packages[packageId]?.status).toBe("queued");
|
expect(session.packages[packageId]?.status).toBe("queued");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("requeues completed archive parts on CRC error even when file size matches", () => {
|
it("does not requeue completed archive parts without local file evidence", () => {
|
||||||
const root = fs.mkdtempSync(path.join(os.tmpdir(), "rd-dm-"));
|
const root = fs.mkdtempSync(path.join(os.tmpdir(), "rd-dm-"));
|
||||||
tempDirs.push(root);
|
tempDirs.push(root);
|
||||||
|
|
||||||
@ -2121,18 +2121,13 @@ describe("download manager", () => {
|
|||||||
"hybrid"
|
"hybrid"
|
||||||
);
|
);
|
||||||
|
|
||||||
// CRC error from extractor IS evidence of corruption — even when files
|
expect(changed).toBe(0);
|
||||||
// have the right size, content may be corrupt. Must force re-download.
|
|
||||||
expect(changed).toBe(2);
|
|
||||||
for (const itemId of itemIds) {
|
for (const itemId of itemIds) {
|
||||||
const item = session.items[itemId]!;
|
const item = session.items[itemId]!;
|
||||||
expect(item.status).toBe("queued");
|
expect(item.status).toBe("completed");
|
||||||
expect(item.targetPath).toBe("");
|
expect(item.targetPath).toContain(".rar");
|
||||||
expect(item.downloadedBytes).toBe(0);
|
expect(item.downloadedBytes).toBe(archiveSize);
|
||||||
expect(item.fullStatus).toContain("Auto-Recovery");
|
|
||||||
}
|
}
|
||||||
expect(fs.existsSync(path.join(outputDir, archiveNames[0]!))).toBe(false);
|
|
||||||
expect(fs.existsSync(path.join(outputDir, archiveNames[1]!))).toBe(false);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("does not treat rev files as ready archive parts during disk fallback", async () => {
|
it("does not treat rev files as ready archive parts during disk fallback", async () => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user