@ -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. \n A 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 `
} ,
]
}
}
@ -33,6 +36,11 @@ function plugin(file, librarySettings, inputs, otherArguments) {
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 ` ) ) {
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 += `The ffmpeg string is: ${response.preset}\n`
return response
}