Make eachs stage optional and configurable

This commit is contained in:
MrMeeb 2024-04-21 15:54:43 +00:00
parent 8c341c11fa
commit 93ff21021c

View File

@ -1,13 +1,62 @@
const details = () => ({
id: 'Tdarr_Plugin_MM1_Full_Stack',
Stage: 'Pre-processing',
Name: 'MrMeeb Full Stack Processing',
Type: 'Video',
Operation: 'Transcode',
Description: 'Automatically removes TrueHD and replaces with a suitable AC3 5.1 track, either pre-existing or created.\n Removes non-English and non-German subtitles.\n Transcodes x264 content to HEVC using NVENC, with a focus on quality',
Version: '0.1',
Tags: 'pre-processing',
Inputs: [],
id: 'Tdarr_Plugin_MM1_MrMeeb_Full_Stack',
Stage: 'Pre-processing',
Name: 'MrMeeb Full Stack Processing',
Type: 'Video',
Operation: 'Transcode',
Description: 'Automatically removes TrueHD and replaces with a suitable AC3 5.1 track, either pre-existing or created.\n Removes non-English and non-German subtitles.\n Transcodes x264 content to HEVC using NVENC, with a focus on quality',
Version: '0.1',
Tags: 'pre-processing',
Inputs: [
{
name: 'process_video',
type: 'boolean',
defaultValue: true,
inputUI: {
type: 'dropdown',
options: [
'true',
'false',
],
},
tooltip: `Select whether to process video, or just copy over`,
},
{
name: 'process_audio',
type: 'boolean',
defaultValue: true,
inputUI: {
type: 'dropdown',
options: [
'true',
'false',
],
},
tooltip: `Select whether to process audio, or just copy over`,
},
{
name: 'process_subs',
type: 'boolean',
defaultValue: true,
inputUI: {
type: 'dropdown',
options: [
'true',
'false',
],
},
tooltip: `Select whether to process subs, or just copy over`,
},
{
name: 'crf',
type: 'string', // set the data type of the input ('string', 'number', 'boolean')
defaultValue: '19', // 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')
},
tooltip: `Enter CRF value used for video transcoding.`,
},
],
});
@ -53,6 +102,14 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
const processAudio = (file, librarySettings, inputs, otherArguments) => {
if (inputs.process_audio == false) {
response.infoLog += `Processing audio set to skip. Copying all present tracks over.\n`
}
else {
// Function variables
let audioIdx = -1;
let audioIdxTruehd = -1;
@ -431,6 +488,14 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
const processSubs = (file, librarySettings, inputs, otherArguments) => {
if (inputs.process_subs == false) {
response.infoLog += `Processing subs set to skip. Copying all present tracks over.\n`
}
else {
// Function variables
let subIdx = -1;
@ -496,6 +561,14 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
const processVideo = (file, librarySettings, inputs, otherArguments) => {
if (inputs.process_video == false) {
response.infoLog += `Processing video set to skip. Copying all present tracks over.\n`
}
else {
console.log(` === Running processVideo function === `)
// Check if video track is already HEVC