From 000e1af2bfbdf42db0f7bfe1a816008f176155bd Mon Sep 17 00:00:00 2001 From: John Andrews Date: Mon, 22 Jan 2024 07:55:23 +1300 Subject: [PATCH] added optiont o leave commentary tracks alone --- Scripts/Flow/Video/Video - Set Stream Titles.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Scripts/Flow/Video/Video - Set Stream Titles.js b/Scripts/Flow/Video/Video - Set Stream Titles.js index e9eff74..218e4dc 100644 --- a/Scripts/Flow/Video/Video - Set Stream Titles.js +++ b/Scripts/Flow/Video/Video - Set Stream Titles.js @@ -3,14 +3,15 @@ import { Language } from 'Shared/Language'; /** * Updates audio and or subtitle titles to format `Language / Codec / Bitrate / SampleRate` or `Language / Forced / Codec` * @author John Andrews - * @revision 1 + * @revision 2 * @minimumVersion 24.01.3.0 * @param {bool} Audio If audio stream titles should be updated * @param {bool} Subtitle If subtitle stream titles should be updated + * @param {bool} LeaveCommentaryAlone If commentary streams should be left alone and not renamed * @output Titles were changed * @output No changes were made */ -function Script(Audio, Subtitles) +function Script(Audio, Subtitles, LeaveCommentaryAlone) { let langHelper = new Language(); @@ -26,7 +27,10 @@ function Script(Audio, Subtitles) { let as = Variables.FfmpegBuilderModel.AudioStreams[i]; if(!as) - continue; // no title already + continue; // error handling + + if(LeaveCommentaryAlone && as.Title && /commentary/i.test(as.Title)) + continue; let params = []; if(as.Language)