Update plugin docs

make-only-subtitle-default
HaveAGitGat 4 years ago
parent d193b00d1e
commit 24f35835a8

@ -1,3 +1,4 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
// List any npm dependencies which the plugin needs, they will be auto installed when the plugin runs: // List any npm dependencies which the plugin needs, they will be auto installed when the plugin runs:
module.exports.dependencies = [ module.exports.dependencies = [
'import-fresh', 'import-fresh',
@ -12,13 +13,28 @@ const details = () => {
Operation: 'Transcode', Operation: 'Transcode',
Description: 'This plugin removes metadata (if a title exists). The output container is the same as the original. \n\n', Description: 'This plugin removes metadata (if a title exists). The output container is the same as the original. \n\n',
Version: '1.00', Version: '1.00',
Link: 'https://github.com/HaveAGitGat/Tdarr_Plugin_aaaa_Pre_Proc_Example',
Tags: 'ffmpeg,h265', // Provide tags to categorise your plugin in the plugin browser.Tag options: h265,hevc,h264,nvenc h265,nvenc h264,video only,audio only,subtitle only,handbrake,ffmpeg,radarr,sonarr,pre-processing,post-processing,configurable Tags: 'ffmpeg,h265', // Provide tags to categorise your plugin in the plugin browser.Tag options: h265,hevc,h264,nvenc h265,nvenc h264,video only,audio only,subtitle only,handbrake,ffmpeg,radarr,sonarr,pre-processing,post-processing,configurable
Inputs: [ Inputs: [
// (Optional) Inputs you'd like the user to enter to allow your plugin to be easily configurable from the UI // (Optional) Inputs you'd like the user to enter to allow your plugin to be easily configurable from the UI
{ {
name: 'language', name: 'language',
type: 'string', // set the data type of the input ('string', 'number', 'boolean')
defaultValue: 'eng', // set the default value of the input incase the user enters no input
inputUI: {
type: 'text', // specify how the input UI will appear to the user ('text' or 'dropdown')
},
// inputUI: { // dropdown inputUI example
// type: 'dropdown',
// options: [
// 'false',
// 'true',
// ],
// },
inputUI: {
type: 'text',
},
tooltip: `Enter one language tag here for the language of the subtitles you'd like to keep. tooltip: `Enter one language tag here for the language of the subtitles you'd like to keep.
\\nExample:\\n \\nExample:\\n
@ -34,8 +50,17 @@ const details = () => {
}, },
{ {
name: 'channels', name: 'channels',
tooltip: `Desired audio channel number. type: 'number',
defaultValue: 2,
inputUI: {
type: 'dropdown',
options: [
'1',
'2',
'6',
],
},
tooltip: `Desired audio channel number.
\\nExample:\\n \\nExample:\\n
2`, 2`,
}, },
@ -43,7 +68,10 @@ const details = () => {
}; };
}; };
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => { const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
// Only 'require' dependencies within this function or other functions. Do not require in the top scope. // Only 'require' dependencies within this function or other functions. Do not require in the top scope.
const importFresh = require('import-fresh'); const importFresh = require('import-fresh');
@ -61,7 +89,6 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
container: '.mp4', // The container of the transcoded output file. container: '.mp4', // The container of the transcoded output file.
handBrakeMode: false, // Set whether to use HandBrake or FFmpeg for transcoding handBrakeMode: false, // Set whether to use HandBrake or FFmpeg for transcoding
FFmpegMode: false, FFmpegMode: false,
reQueueAfter: true, // Leave as true. File will be re-qeued afterwards and pass through the plugin filter again to make sure it meets conditions.
infoLog: '', // This will be shown when the user clicks the 'i' (info) button on a file in the output queue if infoLog: '', // This will be shown when the user clicks the 'i' (info) button on a file in the output queue if
// it has been skipped. // it has been skipped.
// Give reasons why it has been skipped ('File has no title metadata, File meets conditions!') // Give reasons why it has been skipped ('File has no title metadata, File meets conditions!')
@ -131,6 +158,8 @@ module.exports.onTranscodeError = function onTranscodeError(
return response; return response;
}; };
module.exports.details = details;
module.exports.plugin = plugin;
// Example file object: // Example file object:
// { // {

@ -7,12 +7,14 @@ const details = () => {
Operation: 'Filter', Operation: 'Filter',
Description: 'This plugin prevents processing files which contain keywords \n\n', Description: 'This plugin prevents processing files which contain keywords \n\n',
Version: '1.00', Version: '1.00',
Link: 'https://github.com/HaveAGitGat/Tdarr_Plugin_bbbb_Filter_Example.js',
Tags: '', Tags: '',
}; };
}; };
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => { const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
// Must return this object at some point in the function else plugin will fail. // Must return this object at some point in the function else plugin will fail.
const response = { const response = {
@ -34,3 +36,5 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
return response; return response;
}; };
module.exports.details = details;
module.exports.plugin = plugin;
Loading…
Cancel
Save