HaveAGitGat / Tdarr

Tdarr - Distributed transcode automation using FFmpeg/HandBrake + Audio/Video library analytics + video health checking (Windows, macOS, Linux & Docker)
Other
2.95k stars 92 forks source link

[Feature Request] Variable Integration - Tdarr With Plugins #132

Closed Migz93 closed 4 years ago

Migz93 commented 4 years ago

Is your feature request related to a problem? Please describe. Starting to see a few plugins that are almost exactly the same except slight variations between them, usually the variation being different qualities. I've also seen a few people on Discord who have copied a community plugin and changed one thing so that it works for them, example is output format.

Describe the solution you'd like I'd like to see an integration between Tdarr and its plugins that allows variables to be set from the web interface. For example we could have a "Remove Subtitles Plugin", within the plugin we have a `var tdarr-SubLangToKeep = eng' And then within Tdarr it would parse the plugin and any variables set beginning with "tdarr-" are shown and configurable within the web interface, with the default being the option set in the plugin. This would allow a single plugin to be used for various different people, one plugin that can be configured to remove various languages of subtitles, vs a plugin to remove each language of subtitle.

I suggest the only loading variables beginning with "tdarr-" or something similar, to distinguish what kind of variables should be shown in Tdarr, and which are part of the script which should not be seen from Tdarr. This same function could be used for stripping audio, for output formats, audio codecs when transcoding, for different quality conversions and I'm sure many other things.

HaveAGitGat commented 4 years ago

I'm doing this already with the plugin creator. It works in exactly the same way in that pre-written plugins are configured by changing a few key variables. Removing subtitles of a specific language is on my list of Actions to add.

Migz93 commented 4 years ago

I think that is a very similar idea but not quite the same. What you're doing is an advanced plugin creator, with almost pre configured configs that you've added in. It's dependant on you having put them in.

If variables could be integrated directly with plugins then the community could create plugins that anyone else could easily pick up and change the variables for them. I think it would clear down multiple community plugins that do almost the same thing, it'd also appeal to a lot of people who aren't confident in editing the plugin code directly.

I'm just trying to avoid you being too much of a single point of failure, aka if you don't have time to create a new "pre configured plugin" then we could just create the configurable community plugin.

HaveAGitGat commented 4 years ago

Yeah I understand what you mean. I suppose if people are interested in making plugins like that then I can add it in.

HaveAGitGat commented 4 years ago

Implemented for 1.104.

Usage: New key/value pair entered in plugin details for required plugin inputs. e.g.:

      ...
     Link:""
     Inputs: [
      {
        name: 'language',
        tooltip: `Enter one language tag here for the language of the subtitles you'd like to keep. For example: eng`
      },
      {
        name: 'channels',
        tooltip: `Desired audio channel number`
      },
    ]

When a plugin is added to the plugin stack, input options will be displayed: image

Entered inputs will then be passed to plugins upon execution e.g.: image