mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 23:48:15 -07:00
Init flow plugins
This commit is contained in:
parent
92f97a8c81
commit
7521d7eef0
67 changed files with 4765 additions and 0 deletions
|
|
@ -0,0 +1,62 @@
|
|||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
|
||||
import {
|
||||
IpluginDetails,
|
||||
IpluginInputArgs,
|
||||
IpluginOutputArgs,
|
||||
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';
|
||||
import { Istreams } from '../../../../FlowHelpers/1.0.0/interfaces/synced/IFileObject';
|
||||
|
||||
/* eslint-disable no-param-reassign */
|
||||
const details = () :IpluginDetails => ({
|
||||
name: 'Start',
|
||||
description: 'Start FFmpeg Command',
|
||||
style: {
|
||||
borderColor: 'green',
|
||||
},
|
||||
tags: 'video',
|
||||
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: 1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const plugin = (args:IpluginInputArgs):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 containerParts = args.inputFileObj._id.split('.');
|
||||
const container = containerParts[containerParts.length - 1];
|
||||
|
||||
const ffmpegCommand = {
|
||||
inputFiles: [],
|
||||
streams: JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams)).map((stream:Istreams) => ({
|
||||
...stream,
|
||||
removed: false,
|
||||
targetCodec: stream.codec_name,
|
||||
args: [],
|
||||
})),
|
||||
container,
|
||||
};
|
||||
|
||||
args.variables.ffmpegCommand = ffmpegCommand;
|
||||
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
export {
|
||||
details,
|
||||
plugin,
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue