v2 Dependencies addition

This commit is contained in:
HaveAGitGat 2021-01-26 17:25:11 +01:00
parent 13b0ec0221
commit b79f45db6b
2 changed files with 81 additions and 66 deletions

View file

@ -1,19 +1,24 @@
// List any npm dependencies which the plugin needs, they will be auto installed when the plugin runs:
module.exports.dependencies = [
'import-fresh',
];
module.exports.details = function details() {
return {
id: "Tdarr_Plugin_zzzz_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: "",
Description: `This plugin does some stuff after all plugins have been executed. \n\n`,
Version: "1.00",
Link: "https://github.com/HaveAGitGat/Tdarr_Plugin_aaaa_Post_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
id: 'Tdarr_Plugin_zzzz_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: '',
Description: 'This plugin does some stuff after all plugins have been executed. \n\n',
Version: '1.00',
Link: 'https://github.com/HaveAGitGat/Tdarr_Plugin_aaaa_Post_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
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',
tooltip: `Enter one language tag here for the language of the subtitles you'd like to keep.
\\nExample:\\n
@ -23,10 +28,10 @@ module.exports.details = function details() {
fr
\\nExample:\\n
de`, //Each line following `Example:` will be clearly formatted. \\n used for line breaks
de`, // Each line following `Example:` will be clearly formatted. \\n used for line breaks
},
{
name: "channels",
name: 'channels',
tooltip: `Desired audio channel number.
\\nExample:\\n
@ -37,12 +42,15 @@ module.exports.details = function details() {
};
module.exports.plugin = function plugin(file, librarySettings, inputs) {
// 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."
'Transcode success! Now do some stuff with the newly scanned file.',
);
//Optional response if you need to modify database
var response = {
// Optional response if you need to modify database
const response = {
file,
removeFromDB: false,
updateDB: false,
@ -51,7 +59,7 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
return response;
};
//Example file object:
// Example file object:
// {
// _id: 'C:/Users/H/Desktop/Test Input1/Sample.mp4',
// DB: 'ZRPDmnmpyuAEQi7nG',