Compare commits

..

No commits in common. "85889de7908d40fcec8f6081d71206b5b27b0f5c" and "da9417c4f7461e5a57ab84b2f9846c4807564d34" have entirely different histories.

2 changed files with 2 additions and 20 deletions

View File

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

View File

@ -438,26 +438,13 @@ export function collectArchiveCleanupTargets(sourceArchivePath: string, director
}
};
// Companion metadata files (.sfv, .nfo, .md5, etc.) share the same base stem
// as the archive and should be cleaned up together with the archive parts.
const COMPANION_EXTS_RE = /\.(?:sfv|nfo|nzb|md5|sha1|sha256|crc|srr)$/i;
const addCompanions = (stemRe: string): void => {
for (const candidate of filesInDir) {
if (!COMPANION_EXTS_RE.test(candidate)) continue;
const candidateStem = candidate.replace(/\.[^.]+$/, "");
if (new RegExp(`^${stemRe}$`, "i").test(candidateStem)) {
targets.add(path.join(dir, candidate));
}
}
};
const multipartRar = fileName.match(/^(.*)\.part\d+\.rar$/i);
if (multipartRar) {
const prefix = escapeRegex(multipartRar[1]);
addMatching(new RegExp(`^${prefix}\\.part\\d+\\.rar$`, "i"));
// RAR5 recovery volumes: prefix.partN.rev AND legacy prefix.rev
addMatching(new RegExp(`^${prefix}\\.part\\d+\\.rev$`, "i"));
addMatching(new RegExp(`^${prefix}\\.rev$`, "i"));
addCompanions(prefix);
return Array.from(targets);
}
@ -466,7 +453,6 @@ export function collectArchiveCleanupTargets(sourceArchivePath: string, director
addMatching(new RegExp(`^${stem}\\.rar$`, "i"));
addMatching(new RegExp(`^${stem}\\.r\\d{2,3}$`, "i"));
addMatching(new RegExp(`^${stem}\\.rev$`, "i"));
addCompanions(stem);
return Array.from(targets);
}
@ -474,7 +460,6 @@ export function collectArchiveCleanupTargets(sourceArchivePath: string, director
const stem = escapeRegex(fileName.replace(/\.zip$/i, ""));
addMatching(new RegExp(`^${stem}\\.zip$`, "i"));
addMatching(new RegExp(`^${stem}\\.z\\d{2,3}$`, "i"));
addCompanions(stem);
return Array.from(targets);
}
@ -483,7 +468,6 @@ export function collectArchiveCleanupTargets(sourceArchivePath: string, director
const stem = escapeRegex(splitZip[1]);
addMatching(new RegExp(`^${stem}\\.zip$`, "i"));
addMatching(new RegExp(`^${stem}\\.zip\\.\\d{3}$`, "i"));
addCompanions(stem);
return Array.from(targets);
}
@ -491,7 +475,6 @@ export function collectArchiveCleanupTargets(sourceArchivePath: string, director
const stem = escapeRegex(fileName.replace(/\.7z$/i, ""));
addMatching(new RegExp(`^${stem}\\.7z$`, "i"));
addMatching(new RegExp(`^${stem}\\.7z\\.\\d{3}$`, "i"));
addCompanions(stem);
return Array.from(targets);
}
@ -500,7 +483,6 @@ export function collectArchiveCleanupTargets(sourceArchivePath: string, director
const stem = escapeRegex(splitSeven[1]);
addMatching(new RegExp(`^${stem}\\.7z$`, "i"));
addMatching(new RegExp(`^${stem}\\.7z\\.\\d{3}$`, "i"));
addCompanions(stem);
return Array.from(targets);
}