mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-17 03:06:27 -07:00
Latest updates to add subtitles
This commit is contained in:
parent
773a6c12fc
commit
333ade3cad
1 changed files with 11 additions and 1 deletions
|
|
@ -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`,
|
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",
|
Version: "1.3",
|
||||||
Link: "https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js",
|
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: [
|
Inputs: [
|
||||||
{
|
{
|
||||||
name: 'install_packages',
|
name: 'install_packages',
|
||||||
tooltip: `Please change this to "yes", it allows the plugin to install the required nodemodule. (iso-639-2)`
|
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`
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -33,6 +36,11 @@ function plugin(file, librarySettings, inputs, otherArguments) {
|
||||||
infoLog: `Searching new subtitles...\n`,
|
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 (inputs.install_packages == "yes") {
|
||||||
if (!fs.existsSync(`${otherArguments.homePath}/Tdarr/node_modules/iso-639-2`)) {
|
if (!fs.existsSync(`${otherArguments.homePath}/Tdarr/node_modules/iso-639-2`)) {
|
||||||
execSync(`cd ${otherArguments.homePath}/Tdarr \n npm install iso-639-2`);
|
execSync(`cd ${otherArguments.homePath}/Tdarr \n npm install iso-639-2`);
|
||||||
|
|
@ -126,6 +134,8 @@ function plugin(file, librarySettings, inputs, otherArguments) {
|
||||||
response.infoLog += `No new subtitle languages were found\n`;
|
response.infoLog += `No new subtitle languages were found\n`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//response.infoLog += `The ffmpeg string is: ${response.preset}\n`
|
||||||
|
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue