From 652e3848b3333f4c9581058c36a15be36ac9e27e Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Wed, 3 Mar 2021 18:11:26 -0500 Subject: [PATCH] Check for forced subs in video files --- root/scripts/video-pp.bash | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/root/scripts/video-pp.bash b/root/scripts/video-pp.bash index 13d1bbf..d7c08d0 100644 --- a/root/scripts/video-pp.bash +++ b/root/scripts/video-pp.bash @@ -109,6 +109,9 @@ function Main { SubtitleTracksLanguage=$(echo "${tracks}" | jq -r ".streams[] | select(.codec_type==\"subtitle\") | select(.tags.language==\"${VIDEO_LANG}\") | .index") SubtitleTracksLanguageCount=$(echo "${tracks}" | jq -r ".streams[] | select(.codec_type==\"subtitle\") | select(.tags.language==\"${VIDEO_LANG}\") | .index" | wc -l) SubtitleTracksLanguageFound=$(echo "${tracks}" | jq -r ".streams[] | select(.codec_type==\"subtitle\") | .tags.language") + # check for forced subs + SubtitleTracksLanguageForced=$(echo "${tracks}" | jq -r ".streams[] | select(.codec_type==\"subtitle\") | select(.tags.language==\"${VIDEO_LANG}\") | select(.disposition.forced=="1") | .index") + SubtitleTracksLanguageForcedCount=$(echo "${tracks}" | jq -r ".streams[] | select(.codec_type==\"subtitle\") | select(.tags.language==\"${VIDEO_LANG}\") | select(.disposition.forced=="1") | .index" | wc -l) else log "ERROR: ffprobe failed to read tracks and set values" rm "$video" && log "INFO: deleted: $video" @@ -145,6 +148,9 @@ function Main { if [ ! -z "${SubtitleTracksLanguage}" ]; then log "$SubtitleTracksLanguageCount \"${VIDEO_LANG}\" subtitle track found!" fi + if [ ! -z "${SubtitleTracksLanguageForced}" ]; then + log "$SubtitleTracksLanguageForcedCount \"${VIDEO_LANG}\" forced subtitle track found!" + fi else if [ ${VIDEO_MKVCLEANER} = TRUE ] || [ ${VIDEO_SMA} = TRUE ]; then if [ ! -z "$AudioTracksLanguageUND" ] || [ ! -z "$AudioTracksLanguageNull" ]; then