From 69255ee5772521d9a34615a656a30ef3d389fe9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Sat, 8 Oct 2022 01:11:10 +0200 Subject: [PATCH] strip_track_except: actually use UNDESIRED_TRACK_COUNT --- strip_track_except.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strip_track_except.sh b/strip_track_except.sh index 539b0e3..86705fd 100755 --- a/strip_track_except.sh +++ b/strip_track_except.sh @@ -18,7 +18,7 @@ TRACK_COUNT=$(echo "$JSON_OUTPUT" | jq length) [[ $TRACK_COUNT -lt 2 ]] && echo -e "\tFile has only 1 track, skipping." && exit 1 # check if tracks other than the one to keep are present UNDESIRED_TRACK_COUNT=$(echo "$JSON_OUTPUT" | jq '[.[] | select(.properties.language!="$LANGUAGE_TO_KEEP")] | length') -[[ $TRACK_COUNT -lt 2 ]] && echo -e "\tFile has only '$LANGUAGE_TO_KEEP' tracks, skipping." && exit 1 +[[ $UNDESIRED_TRACK_COUNT -lt 2 ]] && echo -e "\tFile has only '$LANGUAGE_TO_KEEP' tracks, skipping." && exit 1 FILENAME_WITHOUT_EXT=${FILENAME%.*} echo -e "\tRemoving all audio tracks except '$LANGUAGE_TO_KEEP' tracks..." pv "$FILENAME" | ffmpeg -i pipe:0 -map 0:v -map 0:a:m:language:${LANGUAGE_TO_KEEP} -map 0:s -c copy -v warning "${FILENAME_WITHOUT_EXT}.converted.mkv"