mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 23:48:15 -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
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue