Tdarr_Plugins/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js
Migz93 7b84114d83 Migz Plugin Additions
1) Transcode plugin using nvidia GPU.

2) Plugin to clean title metadata from video if detected. This only cleans the title, the current plugin cleans all metadata if title is detected.

3) Plugin to clean audio, remove unwanted languages & tag unknown language tracks.

4) Plugin to clean subtitles, remove unwanted languages & tag unknown language tracks.

5) Plugin to convert stereo tracks to AAC and/or create downmix audio tracks.

6) Organise streams into order.
2020-02-07 22:15:09 +00:00

65 lines
No EOL
1.6 KiB
JavaScript

function details() {
return {
id: "Tdarr_Plugin_MC93_Migz2CleanTitle",
Stage: "Pre-processing",
Name: "Migz-Clean title metadata",
Type: "Video",
Operation: "Clean",
Description: `[TESTING]This plugin removes video title metadata if it exists. \n\n`,
Version: "1.00",
Link: ""
}
}
function plugin(file) {
var response = {
processFile : false,
preset : '',
container: '.' + file.container,
handBrakeMode : false,
FFmpegMode : true,
reQueueAfter : false,
infoLog : '',
}
var ffmpegCommandInsert = ''
var videoIdx = 0
var convert = false
if (file.fileMedium !== "video") {
console.log("File is not video")
response.infoLog += "☒File is not video \n"
response.processFile = false;
return response
}
if(file.meta.Title != undefined ){
ffmpegCommandInsert += ` -metadata title="" `
convert = true
}
for (var i = 0; i < file.ffProbeData.streams.length; i++) {
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "video") {
if (file.ffProbeData.streams[i].tags.title != undefined) {
ffmpegCommandInsert += ` -metadata:s:v:${videoIdx} title="" `
convert = true
}
videoIdx++
}
}
if(convert == true){
response.infoLog += "☒File has title metadata \n"
response.preset = `,${ffmpegCommandInsert} -c copy`
response.reQueueAfter = true;
response.processFile = true;
}else{
response.infoLog += "☑File has no title metadata \n"
}
return response
}
module.exports.details = details;
module.exports.plugin = plugin;