feat: Tdarr Local Flow Plugin Suite v1.0
7 atomic plugins for automated x265 transcoding pipeline: - utility/mediaAnalyzerGOP : GOP calc, FPS detection, film/series/anime routing - utility/setAnimationFlag : manual animation flag override - utility/extractChaptersXml : mkvextract chapters to XML - audio/audioSelectorClamping : codec scoring, clamped Opus bitrates, 2 outputs - audio/backupSourceAudio : lossless DTS/TrueHD ITA backup (-c:a copy) - subtitles/extractSubtitlesAndOcr : SRT extract + SubtitleEdit OCR for PGS - video/transcode2PassX265 : 2-pass x265, Lanczos 1080p bound, Opus mux Test suite: 34 unit tests + 3 integration tests (FFmpeg real files) FlowHelpers mock for local testing included Docs: integration-guide.md with canvas wiring and deploy instructions
This commit is contained in:
commit
c2074be826
19 files changed
+2134
No files matched your search
@@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
/**
|
||||
* Local mock of Tdarr FlowHelpers/1.0.0/cliUtils.js
|
||||
* Used only for local testing — on real Tdarr this file comes from the server.
|
||||
*/
|
||||
const { spawn } = require('child_process');
|
||||
|
||||
class CLI {
|
||||
constructor(config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
runCli() {
|
||||
return new Promise((resolve) => {
|
||||
const { cli, spawnArgs, WorkDir, jobLog } = this.config;
|
||||
|
||||
if (jobLog) jobLog(`[CLI] Running: ${cli} ${spawnArgs.join(' ')}\n`);
|
||||
|
||||
const proc = spawn(cli, spawnArgs, {
|
||||
cwd: WorkDir || process.cwd(),
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
shell: false,
|
||||
});
|
||||
|
||||
proc.stdout.on('data', (d) => { if (jobLog) jobLog(d.toString()); });
|
||||
proc.stderr.on('data', (d) => { if (jobLog) jobLog(d.toString()); });
|
||||
|
||||
proc.on('close', (code) => {
|
||||
resolve({ cliExitCode: code || 0 });
|
||||
});
|
||||
|
||||
proc.on('error', (err) => {
|
||||
if (jobLog) jobLog(`[CLI] Error: ${err.message}\n`);
|
||||
resolve({ cliExitCode: 1 });
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const getFFmpegVar = () => {};
|
||||
|
||||
module.exports = { CLI, getFFmpegVar };
|
||||
Reference in new issue
Block a user