mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-10 07:50:29 -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 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Check Video Codec',
|
||||
description: 'Check if a file has a specific video codec',
|
||||
style: {
|
||||
borderColor: 'orange',
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [
|
||||
{
|
||||
name: 'codec',
|
||||
type: 'string',
|
||||
defaultValue: 'hevc',
|
||||
inputUI: {
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
'hevc',
|
||||
'vp9',
|
||||
'h264',
|
||||
'vp8',
|
||||
],
|
||||
},
|
||||
tooltip: 'Specify the codec check for',
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'File has codec',
|
||||
},
|
||||
{
|
||||
number: 2,
|
||||
tooltip: 'File does not have codec',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
var hasCodec = false;
|
||||
// @ts-expect-error type
|
||||
args.inputFileObj.ffProbeData.streams.forEach(function (stream) {
|
||||
if (stream.codec_type === 'video' && stream.codec_name === args.inputs.codec) {
|
||||
hasCodec = true;
|
||||
}
|
||||
});
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: hasCodec ? 1 : 2,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
Loading…
Add table
Add a link
Reference in a new issue