strip_track_except: fix UNDESIRED_TRACK_COUNT
This commit is contained in:
parent
c33104c552
commit
8dcb77789d
|
@ -17,8 +17,8 @@ TRACK_COUNT=$(echo "$JSON_OUTPUT" | jq length)
|
||||||
# check if more than 1 audio track is present
|
# check if more than 1 audio track is present
|
||||||
[[ $TRACK_COUNT -lt 2 ]] && echo -e "\tFile has only 1 track, skipping." && exit 1
|
[[ $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
|
# 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')
|
UNDESIRED_TRACK_COUNT=$(echo "$JSON_OUTPUT" | jq "[.[] | select(.properties.language!=\"${LANGUAGE_TO_KEEP}\")] | length")
|
||||||
[[ $UNDESIRED_TRACK_COUNT -lt 2 ]] && echo -e "\tFile has only '$LANGUAGE_TO_KEEP' tracks, skipping." && exit 1
|
[[ $UNDESIRED_TRACK_COUNT -eq 0 ]] && echo -e "\tFile has only '$LANGUAGE_TO_KEEP' tracks, skipping." && exit 1
|
||||||
FILENAME_EXT=${FILENAME##*.}
|
FILENAME_EXT=${FILENAME##*.}
|
||||||
echo -e "\tRemoving all audio tracks except '$LANGUAGE_TO_KEEP' tracks..."
|
echo -e "\tRemoving all audio tracks except '$LANGUAGE_TO_KEEP' tracks..."
|
||||||
TMPFILE=$(mktemp)
|
TMPFILE=$(mktemp)
|
||||||
|
|
Loading…
Reference in New Issue