Compare commits
2 Commits
68bfeb574f
...
da9417c4f7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da9417c4f7 | ||
|
|
021401e3b6 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "real-debrid-downloader",
|
"name": "real-debrid-downloader",
|
||||||
"version": "1.7.125",
|
"version": "1.7.126",
|
||||||
"description": "Desktop downloader",
|
"description": "Desktop downloader",
|
||||||
"main": "build/main/main/main.js",
|
"main": "build/main/main/main.js",
|
||||||
"author": "Sucukdeluxe",
|
"author": "Sucukdeluxe",
|
||||||
|
|||||||
@ -10110,13 +10110,30 @@ export class DownloadManager extends EventEmitter {
|
|||||||
.filter((entry) => entry.isFile())
|
.filter((entry) => entry.isFile())
|
||||||
.map((entry) => entry.name);
|
.map((entry) => entry.name);
|
||||||
} catch { /* ignore */ }
|
} catch { /* ignore */ }
|
||||||
|
const archiveStems = new Set<string>();
|
||||||
for (const archiveKey of readyArchives) {
|
for (const archiveKey of readyArchives) {
|
||||||
const parts = collectArchiveCleanupTargets(archiveKey, dirFiles);
|
const parts = collectArchiveCleanupTargets(archiveKey, dirFiles);
|
||||||
for (const part of parts) {
|
for (const part of parts) {
|
||||||
hybridFileNames.add(path.basename(part).toLowerCase());
|
const partName = path.basename(part).toLowerCase();
|
||||||
|
hybridFileNames.add(partName);
|
||||||
|
// Collect archive base stems (without .partNN.rar / .rar / .rNN) to find companion files
|
||||||
|
const stem = partName.replace(/\.part\d+\.rar$|\.r\d{2,3}$|\.rar$/i, "");
|
||||||
|
if (stem && stem !== partName) archiveStems.add(stem);
|
||||||
}
|
}
|
||||||
hybridFileNames.add(path.basename(archiveKey).toLowerCase());
|
hybridFileNames.add(path.basename(archiveKey).toLowerCase());
|
||||||
}
|
}
|
||||||
|
// Include companion metadata files (.sfv, .nfo, etc.) that belong to the same archive set.
|
||||||
|
// These files share the same basename stem as the archive parts.
|
||||||
|
if (dirFiles && archiveStems.size > 0) {
|
||||||
|
for (const fileName of dirFiles) {
|
||||||
|
const lower = fileName.toLowerCase();
|
||||||
|
if (!KNOWN_SMALL_FILE_RE.test(lower)) continue;
|
||||||
|
const companionStem = lower.replace(/\.[^.]+$/, "");
|
||||||
|
if (archiveStems.has(companionStem)) {
|
||||||
|
hybridFileNames.add(lower);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
const isHybridItem = (item: DownloadItem): boolean => {
|
const isHybridItem = (item: DownloadItem): boolean => {
|
||||||
if (item.targetPath && hybridFileNames.has(path.basename(item.targetPath).toLowerCase())) {
|
if (item.targetPath && hybridFileNames.has(path.basename(item.targetPath).toLowerCase())) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user