Save uncommitted changes
Build / Lint & Test (push) Successful in 22s

This commit is contained in:
PickleRick committed 2026-09-21 10:42:08 +02:00
1 parent 3f0b38d513
commit a8c4a81141
8 files changed
+271 -19

No files matched your search

@@ -15,7 +15,7 @@ const fs = require('fs');
* - The network path is slow or unreliable during long encodes
*
* Flow:
* 1. Copies source → workDir/<basename><ext> (streams, no RAM load)
* 1. Copies source → workDir/<basename>_old<ext> (streams, no RAM load)
* 2. Updates outputFileObj._id to the local copy path
* 3. Downstream plugins operate on the local copy
* 4. Tdarr replaces the original with the final output as usual
@@ -63,7 +63,7 @@ const plugin = async (args) => {
const inputFile = inputFileObj._id;
const ext = path.extname(inputFile);
const baseName = path.basename(inputFile, ext);
const localCopy = path.join(workDir, `${baseName}${ext}`);
const localCopy = path.join(workDir, `${baseName}_old${ext}`);
jobLog(`[copyToWorkDir] Source : ${inputFile}\n`);
jobLog(`[copyToWorkDir] WorkDir: ${workDir}\n`);
@@ -80,6 +80,8 @@ const plugin = async (args) => {
variables.originalLibraryFile = inputFile;
variables.originalLibraryDir = path.dirname(inputFile);
}
variables.workDirSourceBaseName = baseName;
variables.workDirCopyApplied = 'true';
// ── Copy using streams (no RAM spike for large files) ────────────────────
const sourceSize = fs.statSync(inputFile).size;