mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 15:38:19 -07:00
Check plugins (#221)
* Include examples in checkPlugins. Fix errors and lint. * Remove on push * Show tick for successful tests
This commit is contained in:
parent
31895e8afc
commit
9bbc4fbec9
9 changed files with 404 additions and 854 deletions
83
examples/Tdarr_Plugin_pos1_Post_Proc_Example.js
Normal file
83
examples/Tdarr_Plugin_pos1_Post_Proc_Example.js
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
// Rules disabled for example purposes
|
||||
/* eslint max-len: 0 */ // --> OFF
|
||||
/* eslint no-unused-vars: 0 */ // --> OFF
|
||||
/* eslint global-require: 0 */ // --> OFF
|
||||
/* eslint import/no-extraneous-dependencies: 0 */ // --> OFF
|
||||
/* eslint no-console: 0 */ // --> OFF
|
||||
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
const loadDefaultValues = require('../methods/loadDefaultValues');
|
||||
|
||||
// List any npm dependencies which the plugin needs, they will be auto installed when the plugin runs:
|
||||
module.exports.dependencies = [
|
||||
'import-fresh',
|
||||
];
|
||||
|
||||
const details = () => ({
|
||||
id: 'Tdarr_Plugin_pos1_Post_Proc_Example',
|
||||
Stage: 'Post-processing', // Preprocessing or Post-processing. Determines when the plugin will be executed. This plugin does some stuff after all plugins have been executed
|
||||
Name: 'Post proc ',
|
||||
Type: 'Video',
|
||||
Operation: 'Transcode',
|
||||
Description: 'This plugin does some stuff after all plugins have been executed. \n\n',
|
||||
Version: '1.00',
|
||||
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: [
|
||||
// (Optional) Inputs you'd like the user to enter to allow your plugin to be easily configurable from the UI
|
||||
{
|
||||
name: 'language',
|
||||
type: 'string',
|
||||
defaultValue: 'eng',
|
||||
inputUI: {
|
||||
type: 'text',
|
||||
},
|
||||
tooltip: `Enter one language tag here for the language of the subtitles you'd like to keep.
|
||||
|
||||
\\nExample:\\n
|
||||
eng
|
||||
|
||||
\\nExample:\\n
|
||||
fr
|
||||
|
||||
\\nExample:\\n
|
||||
de`, // Each line following `Example:` will be clearly formatted. \\n used for line breaks
|
||||
},
|
||||
{
|
||||
name: 'channels',
|
||||
type: 'string',
|
||||
defaultValue: 'eng',
|
||||
inputUI: {
|
||||
type: 'text',
|
||||
},
|
||||
tooltip: `Desired audio channel number.
|
||||
|
||||
\\nExample:\\n
|
||||
2`,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
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.
|
||||
const importFresh = require('import-fresh');
|
||||
|
||||
console.log(
|
||||
'Transcode success! Now do some stuff with the newly scanned file.',
|
||||
);
|
||||
|
||||
// Optional response if you need to modify database
|
||||
const response = {
|
||||
file,
|
||||
removeFromDB: false,
|
||||
updateDB: false,
|
||||
};
|
||||
|
||||
return response;
|
||||
};
|
||||
module.exports.details = details;
|
||||
module.exports.plugin = plugin;
|
||||
Loading…
Add table
Add a link
Reference in a new issue