mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-14 17:55:55 -07:00
removed duplicated parameter setting (#210)
* removed duplicated parameter setting * Prevent duplicate plugin inputs Co-authored-by: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com>
This commit is contained in:
parent
0081942d25
commit
df1993f940
2 changed files with 9 additions and 8 deletions
|
|
@ -28,14 +28,6 @@ const details = () => ({
|
||||||
type: 'text',
|
type: 'text',
|
||||||
},
|
},
|
||||||
tooltip: 'FFMPEG encoder used for the output of the new tracks. Defaults to ac3.',
|
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',
|
name: 'position_new_audio',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,16 @@ module.exports.plugin = plugin;`;
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
} else if (pluginDetails.Inputs && Array.isArray(pluginDetails.Inputs)) {
|
} else if (pluginDetails.Inputs && Array.isArray(pluginDetails.Inputs)) {
|
||||||
const inputs = pluginDetails.Inputs;
|
const inputs = pluginDetails.Inputs;
|
||||||
|
const savedInputs = {};
|
||||||
for (let j = 0; j < inputs.length; j += 1) {
|
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]);
|
const inputKeys = Object.keys(inputs[j]);
|
||||||
if (
|
if (
|
||||||
inputKeys[0] !== 'name'
|
inputKeys[0] !== 'name'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue