mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-15 02:05:54 -07:00
Migz Plugins Fix
Both plugins checked for the existance of file.ffProbeData.streams[i].tags.language. But when .tags is completely missing then it would fail. Modified plugins to check for .tags before then checking for .language
This commit is contained in:
parent
673a677e26
commit
1a7d1cafc9
2 changed files with 23 additions and 7 deletions
|
|
@ -6,7 +6,7 @@ function details() {
|
|||
Type: "Audio",
|
||||
Operation: "Clean",
|
||||
Description: `This plugin keeps only specified language audio tracks & can tags those that have an unknown language. \n\n`,
|
||||
Version: "2.1",
|
||||
Version: "2.2",
|
||||
Link: "https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js",
|
||||
Tags: 'pre-processing,ffmpeg,audio only,configurable',
|
||||
Inputs: [{
|
||||
|
|
@ -123,12 +123,20 @@ function plugin(file, librarySettings, inputs) {
|
|||
}
|
||||
} catch (err) {}
|
||||
|
||||
// Checks if the tags.language metadata is completely missing, if so this would cause playback to show language as "undefined". No catch error here otherwise it would never detect the metadata as missing.
|
||||
if (typeof file.ffProbeData.streams[i].tags.language == 'undefined') {
|
||||
// Checks if the tags metadata is completely missing, if so this would cause playback to show language as "undefined". No catch error here otherwise it would never detect the metadata as missing.
|
||||
if (typeof file.ffProbeData.streams[i].tags == 'undefined') {
|
||||
ffmpegCommandInsert += `-metadata:s:a:${audioIdx} language=${inputs.tag_language} `
|
||||
response.infoLog += `☒Audio stream detected as having no language tagged, tagging as ${inputs.tag_language}. \n`
|
||||
convert = true
|
||||
}
|
||||
// Checks if the tags.language metadata is completely missing, if so this would cause playback to show language as "undefined". No catch error here otherwise it would never detect the metadata as missing.
|
||||
else {
|
||||
if (typeof file.ffProbeData.streams[i].tags.language == 'undefined') {
|
||||
ffmpegCommandInsert += `-metadata:s:a:${audioIdx} language=${inputs.tag_language} `
|
||||
response.infoLog += `☒Audio stream detected as having no language tagged, tagging as ${inputs.tag_language}. \n`
|
||||
convert = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue