2013-03-03 00:01:20 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2015-09-12 15:10:22 +02:00
|
|
|
_usage() {
|
|
|
|
cat<<EOF
|
|
|
|
Usage: ${0##*/} FOLDERS
|
|
|
|
|
|
|
|
Print audio files found in FOLDERS with
|
|
|
|
- constant bitrate;
|
|
|
|
- embedded covers;
|
|
|
|
- leading zeros in tags.
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ $# -eq 0 ] || [ "$1" = "-h" ]; then
|
|
|
|
_usage
|
2014-11-12 16:15:39 +01:00
|
|
|
exit
|
2013-03-03 00:01:20 +01:00
|
|
|
fi
|
|
|
|
|
2015-09-12 15:10:22 +02:00
|
|
|
if ! command -v mediainfo >/dev/null 2>&1; then
|
|
|
|
echo >&2 "mediainfo required."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
for j; do
|
|
|
|
while IFS= read -r i; do
|
|
|
|
BUFFER="$(mediainfo "$i")"
|
2016-06-23 23:18:36 +02:00
|
|
|
echo "$BUFFER" | grep -q "Bit rate mode *: Constant" && echo "$i : CBR"
|
|
|
|
echo "$BUFFER" | grep -q "Cover *: Yes" && echo "$i : Cover"
|
|
|
|
echo "$BUFFER" | grep -q "Track name/Position *: 0+" && echo "$i : Leading zeros"
|
2015-09-12 15:10:22 +02:00
|
|
|
done <<EOF
|
|
|
|
$(find "$j" \( \
|
2014-11-12 16:15:39 +01:00
|
|
|
-iname '*.mp3' -o \
|
|
|
|
-iname '*.flac' -o \
|
|
|
|
-iname '*.wv' -o \
|
|
|
|
-iname '*.aac' -o \
|
|
|
|
-iname '*.wav' -o \
|
2015-09-12 15:10:22 +02:00
|
|
|
-iname '*.wma' -o \
|
|
|
|
-iname '*.ogg' -o \
|
|
|
|
-iname '*.ac3' -o \
|
|
|
|
-iname '*.dts' -o \
|
2014-11-12 16:15:39 +01:00
|
|
|
-iname '*.ape' -o \
|
|
|
|
-iname '*.mpc' \) )
|
2013-03-03 00:01:20 +01:00
|
|
|
EOF
|
2015-09-12 15:10:22 +02:00
|
|
|
done
|