feat(transcode): scale 2-pass progress to 50% per pass for total 100%

This commit is contained in:
PickleRick committed 2026-09-30 23:58:28 +02:00
1 parent 2daa75df60
commit 70f065a3a2
2 files changed
+87 -7

No files matched your search

+9 -1
View File
@@ -236,8 +236,16 @@ const AUDIO_INPUTS = {
ok(transcodeCode.includes("normalizedKey === 'bps' || normalizedKey === 'bps-eng'"), 'HEVC copy check falls back to Matroska BPS metadata');
ok(transcodeCode.includes('containerBitrate - otherStreamBitrate'), 'HEVC copy check estimates video bitrate from container and companion streams');
ok(!transcodeCode.includes("'-map_metadata -1'"), 'pass 1 separates -map_metadata from its value');
ok(!transcodeCode.includes("'-map_chapters -1'"), 'pass 1 separates -map_chapters from its value');
ok(transcodeCode.includes('const statsForX265 = path.basename(statsFile)'), 'x265 stats file is relative to workDir on Windows');
const { scalePassPercentage } = require(path.join(ROOT, 'LocalFlowPlugins/video/transcode2PassX265/1.0.0/index.js'));
eq(scalePassPercentage(1, 0), 0, 'pass 1 at 0% maps to 0%');
eq(scalePassPercentage(1, 50), 25, 'pass 1 at 50% maps to 25%');
eq(scalePassPercentage(1, 100), 50, 'pass 1 at 100% maps to 50%');
eq(scalePassPercentage(2, 0), 50, 'pass 2 at 0% maps to 50%');
eq(scalePassPercentage(2, 50), 75, 'pass 2 at 50% maps to 75%');
eq(scalePassPercentage(2, 100), 100, 'pass 2 at 100% maps to 100%');
ok(transcodeCode.includes('scalePassPercentage(1,'), 'pass 1 wraps updateWorker with 50% scale');
ok(transcodeCode.includes('scalePassPercentage(2,'), 'pass 2 wraps updateWorker with 50% scale');
// ── copyToWorkDir & replaceOriginalFile v1.0.0 checks ─────────────────────
const copyPluginCode = require('fs').readFileSync(path.join(ROOT, 'LocalFlowPlugins/utility/copyToWorkDir/1.0.0/index.js'), 'utf8');