Compare commits

...

2 Commits

Author SHA1 Message Date
Sucukdeluxe
f0c37bed80 Release v1.7.108 2026-03-23 12:07:11 +01:00
Sucukdeluxe
79c178eb0d Skip sample files during auto-rename to prevent (2) MKV duplicates
Sample files like wayne-sample.mkv were renamed by auto-rename which
stripped the -sample suffix. After rename they were indistinguishable
from the main MKV, causing MKV collection to create (2) copies
(e.g. Messiah.Superstar.S01E01...WAYNE (2).mkv at 17 MB alongside
the real 470 MB episode).

Auto-rename now skips files with a "sample" token in their name,
matching the same detection used by MKV collection's sample filter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:06:41 +01:00
2 changed files with 9 additions and 1 deletions

View File

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

View File

@ -3307,6 +3307,7 @@ export class DownloadManager extends EventEmitter {
}
}
const sampleTokenRe = /(^|[._\-\s])sample([._\-\s]|$)/i;
for (const sourcePath of videoFiles) {
if (shouldAbort?.()) {
return renamed;
@ -3314,6 +3315,13 @@ export class DownloadManager extends EventEmitter {
const sourceName = path.basename(sourcePath);
const sourceExt = path.extname(sourceName);
const sourceBaseName = path.basename(sourceName, sourceExt);
// Skip sample files — renaming them strips the "-sample" suffix,
// making them indistinguishable from the main MKV and causing (2)
// duplicates during MKV collection.
if (sampleTokenRe.test(sourceBaseName)) {
continue;
}
const folderCandidates: string[] = [];
let currentDir = path.dirname(sourcePath);
while (currentDir && isPathInsideDir(currentDir, extractDir)) {