You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.7 KiB
71 lines
1.7 KiB
import { CLI } from '../../../../FlowHelpers/1.0.0/cliUtils';
|
|
import {
|
|
IpluginDetails,
|
|
IpluginInputArgs,
|
|
IpluginOutputArgs,
|
|
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';
|
|
|
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
|
const details = ():IpluginDetails => ({
|
|
name: 'Run MKVPropEdit',
|
|
description: 'Run MKVPropEdit on a file to update metadata which'
|
|
+ ' FFmpeg doesn\'t typically update such as stream bitrate.',
|
|
style: {
|
|
borderColor: 'green',
|
|
},
|
|
tags: '',
|
|
isStartPlugin: false,
|
|
pType: '',
|
|
requiresVersion: '2.11.01',
|
|
sidebarPosition: -1,
|
|
icon: '',
|
|
inputs: [],
|
|
outputs: [
|
|
{
|
|
number: 1,
|
|
tooltip: 'Continue to next plugin',
|
|
},
|
|
],
|
|
});
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
const plugin = async (args:IpluginInputArgs):Promise<IpluginOutputArgs> => {
|
|
const lib = require('../../../../../methods/lib')();
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
|
|
|
const cliArgs = [
|
|
'--add-track-statistics-tags',
|
|
args.inputFileObj._id,
|
|
];
|
|
|
|
const cli = new CLI({
|
|
cli: args.mkvpropeditPath,
|
|
spawnArgs: cliArgs,
|
|
spawnOpts: {},
|
|
jobLog: args.jobLog,
|
|
outputFilePath: '',
|
|
inputFileObj: args.inputFileObj,
|
|
logFullCliOutput: args.logFullCliOutput,
|
|
updateWorker: args.updateWorker,
|
|
args,
|
|
});
|
|
|
|
const res = await cli.runCli();
|
|
|
|
if (res.cliExitCode !== 0) {
|
|
args.jobLog('Running MKVPropEdit failed');
|
|
throw new Error('Running MKVPropEdit failed');
|
|
}
|
|
|
|
return {
|
|
outputFileObj: args.inputFileObj,
|
|
outputNumber: 1,
|
|
variables: args.variables,
|
|
};
|
|
};
|
|
export {
|
|
details,
|
|
plugin,
|
|
};
|