You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
506 B
Bash

#ft=sh
add_date_prefix () {
DIR=$(dirname "$1")
FILE=$(basename "$1")
DATE=$(date -r "$1" +"%F")
if [ ! -f "$1" ] ; then
echo "unknown file: $1"
return
fi
mv "$1" "$DIR/${DATE}_${FILE}"
}
get_bitrate () {
if [ ! -f "$1" ] ; then
echo "[ERROR] unknown file: $1"
return
fi
if ! command -v exiftool > /dev/null ; then
echo "[ERROR] exiftool not installed"
return
fi
exiftool -AudioBitrate "$1" | awk '{print $4}'
}