dam/src/print_meta_flac

20 lines
418 B
Text
Raw Normal View History

#!/bin/bash
# doc print_meta_flac {
#
# DESCRIPTION
# print_meta_flac - Prints metadata of remote flac in FIELD=VALUE; format.
#
# USAGE
# print_meta_flac </path/to/flac>
#
# }
print_meta_flac() {
local FILE="${1}"
if [[ -f ${FILE} ]]; then
2018-03-28 15:07:17 +00:00
awk 'BEGIN{FS=": ";ORS=";"}{if($1 ~ /comment\[/){print $2}}' <<< $(metaflac --list --block-type=VORBIS_COMMENT "${FILE}") | sed 's|.$||'
fi
}