Update worker with hb fps if available

This commit is contained in:
HaveAGitGat 2024-06-01 06:41:09 +01:00
parent 04bc1281bc
commit 57b4662c3d
2 changed files with 36 additions and 1 deletions

View file

@ -1,4 +1,6 @@
import { editreadyParser, ffmpegParser, handbrakeParser } from './cliParsers';
import {
editreadyParser, ffmpegParser, getHandBrakeFps, handbrakeParser,
} from './cliParsers';
import { Ilog, IupdateWorker } from './interfaces/interfaces';
import { IFileObject, Istreams } from './interfaces/synced/IFileObject';
@ -182,6 +184,16 @@ class CLI {
percentage,
});
}
const fps = getHandBrakeFps({
str,
});
if (fps > 0) {
this.config.updateWorker({
fps,
});
}
} else if (this.config.cli.toLowerCase().includes('ffmpeg')) {
const n = str.indexOf('fps');
const shouldUpdate = str.length >= 6 && n >= 6;