From df1993f94054e8e80d826ec7b112b68c8b367c7e Mon Sep 17 00:00:00 2001 From: michpas <66222810+michpas@users.noreply.github.com> Date: Tue, 14 Dec 2021 08:30:31 +0100 Subject: [PATCH] removed duplicated parameter setting (#210) * removed duplicated parameter setting * Prevent duplicate plugin inputs Co-authored-by: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> --- Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js | 8 -------- tests/checkPlugins.js | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js b/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js index c7b06ad..5a1579e 100644 --- a/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js +++ b/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js @@ -28,14 +28,6 @@ const details = () => ({ type: 'text', }, tooltip: 'FFMPEG encoder used for the output of the new tracks. Defaults to ac3.', - }, { - name: 'position_new_audio', - type: 'string', - defaultValue: '', - inputUI: { - type: 'text', - }, - tooltip: 'postion new audiostream. empty equals post. enter word before to add the new track prior.', }, { name: 'position_new_audio', type: 'string', diff --git a/tests/checkPlugins.js b/tests/checkPlugins.js index 9007b77..65eba49 100644 --- a/tests/checkPlugins.js +++ b/tests/checkPlugins.js @@ -117,7 +117,16 @@ module.exports.plugin = plugin;`; process.exit(1); } else if (pluginDetails.Inputs && Array.isArray(pluginDetails.Inputs)) { const inputs = pluginDetails.Inputs; + const savedInputs = {}; for (let j = 0; j < inputs.length; j += 1) { + // Prevent duplicate plugin inputs + if (savedInputs[inputs[j].name] === true) { + console.log(`Plugin Input already exists: './Community/${files[i]}' : ${inputs[j].name}`); + process.exit(1); + } else { + savedInputs[inputs[j].name] = true; + } + const inputKeys = Object.keys(inputs[j]); if ( inputKeys[0] !== 'name'