fix: pass updateWorker to all CLI constructors; add copyToWorkDir plugin
Build / Lint & Test (push) Successful in 13s

This commit is contained in:
PickleRick committed 2026-09-19 14:28:54 +02:00
1 parent 3b7f660058
commit c604acfe69
6 files changed
+131 -10

No files matched your search

@@ -79,10 +79,10 @@ const buildSuffix = (lang, stream) => {
return parts.join('.');
};
const runFFmpeg = async (spawnArgs, workDir, ffmpegPath, jobLog, inputFileObj) => {
const runFFmpeg = async (spawnArgs, workDir, ffmpegPath, jobLog, inputFileObj, updateWorker) => {
const { CLI } = require('../../../../FlowHelpers/1.0.0/cliUtils');
const cli = new CLI({
cli: ffmpegPath, spawnArgs, WorkDir: workDir, jobLog, inputFileObj,
cli: ffmpegPath, spawnArgs, WorkDir: workDir, jobLog, inputFileObj, updateWorker,
});
return cli.runCli();
};
@@ -90,7 +90,7 @@ const runFFmpeg = async (spawnArgs, workDir, ffmpegPath, jobLog, inputFileObj) =
// ─── Plugin ───────────────────────────────────────────────────────────────────
const plugin = async (args) => {
const { jobLog, inputFileObj, variables, workDir } = args;
const { jobLog, inputFileObj, variables, workDir, updateWorker } = args;
const inputFile = inputFileObj._id;
const sourceDir = path.dirname(inputFile);
@@ -129,7 +129,7 @@ const plugin = async (args) => {
if (TEXT_CODECS.has(codec)) {
const { cliExitCode } = await runFFmpeg(
['-y', '-i', inputFile, '-map', `0:${stream.index}`, '-c:s', 'srt', outSrt],
workDir, args.ffmpegPath, jobLog, inputFileObj,
workDir, args.ffmpegPath, jobLog, inputFileObj, updateWorker,
);
if (cliExitCode !== 0) {
jobLog(`[extractSubtitlesAndOcr] WARNING: FFmpeg failed for stream #${stream.index} (exit ${cliExitCode}).\n`);
@@ -146,7 +146,7 @@ const plugin = async (args) => {
// Step 1: Extract to .sup
const { cliExitCode: extractExit } = await runFFmpeg(
['-y', '-i', inputFile, '-map', `0:${stream.index}`, '-c:s', 'copy', tmpSup],
workDir, args.ffmpegPath, jobLog, inputFileObj,
workDir, args.ffmpegPath, jobLog, inputFileObj, updateWorker,
);
if (extractExit !== 0) {
@@ -167,6 +167,7 @@ const plugin = async (args) => {
WorkDir: workDir,
jobLog,
inputFileObj,
updateWorker,
});
const { cliExitCode: seExit } = await seCli.runCli();