Extend hybrid companion stem matching to all archive types
The stem extraction regex for matching companion metadata files (.sfv, .nfo) to their archives only handled RAR patterns. Now also covers ZIP, 7z, tar, generic splits, and recovery volumes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ee69dcf4cc
commit
49efebd001
@ -10116,8 +10116,12 @@ export class DownloadManager extends EventEmitter {
|
||||
for (const part of parts) {
|
||||
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, "");
|
||||
// Collect archive base stems (strip all archive extensions) to find companion files
|
||||
const stem = partName
|
||||
.replace(/\.part\d+\.rar$/i, "")
|
||||
.replace(/\.(rar|r\d{2,3}|zip|z\d{2,3}|7z|tar|gz|bz2|xz|tgz|tbz2|txz|rev)$/i, "")
|
||||
.replace(/\.(zip|7z)\.\d{3}$/i, "")
|
||||
.replace(/\.\d{3}$/i, "");
|
||||
if (stem && stem !== partName) archiveStems.add(stem);
|
||||
}
|
||||
hybridFileNames.add(path.basename(archiveKey).toLowerCase());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user