Latest updates to add subtitles

make-only-subtitle-default
controlol 6 years ago committed by GitHub
parent 773a6c12fc
commit 333ade3cad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,12 +11,15 @@ function details() {
Description: `This plugin will check for subtitles, they should be named according to the ISO 639-2 language code.\nA subtitle could look like this: eng.srt\n If there are subtitles found they will be added with FFMPEG, if there are no subs of that language found.\n On first run node module iso-639-2 will be installed in the documents folder.\n Created by @control#0405`,
Version: "1.3",
Link: "https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js",
Tags:'pre-processing,ffmpeg,subtitle only,configurable',
Inputs: [
{
name: 'install_packages',
tooltip: `Please change this to "yes", it allows the plugin to install the required nodemodule. (iso-639-2)`
},
{
name: 'container',
tooltip: `Enter the output container of the new file.\\n Default: .mkv\\nExample:\\n.mkv`
},
]
}
}
@ -32,6 +35,11 @@ function plugin(file, librarySettings, inputs, otherArguments) {
reQueueAfter: false,
infoLog: `Searching new subtitles...\n`,
}
if (inputs.container !== undefined) {
response.container = inputs.container;
console.log(`Changed container to: ` + inputs.container);
}
if (inputs.install_packages == "yes") {
if (!fs.existsSync(`${otherArguments.homePath}/Tdarr/node_modules/iso-639-2`)) {
@ -126,6 +134,8 @@ function plugin(file, librarySettings, inputs, otherArguments) {
response.infoLog += `No new subtitle languages were found\n`;
}
//response.infoLog += `The ffmpeg string is: ${response.preset}\n`
return response
}

Loading…
Cancel
Save