3 case $# in 0) set -- .
;; esac
5 parse_vorbis_comment
() {
10 artist
=* | album
=* | musicbrainz_albumid
=*)
12 eval $label=\
${value#*=}
21 find "$@" \
( -name
'*.flac' -o
-name
'*.ogg' -o
-name
'*.mp3' \
) -print | \
25 have_musicbrainz_albumid
=nil
31 parse_vorbis_comment
"$(
32 metaflac --list --block-type=VORBIS_COMMENT "$file" |
33 sed -n '/^.*comment\[[0-9]*\]: /s///p')"
36 parse_vorbis_comment
"$(vorbiscomment "$file")"
39 tag
="$(id3v2 --list "$file")"
40 while read fourcc rest
; do
42 case "$fourcc,$rest" in
43 TPE1
,*) artist
=$rest have_artist
=t
;;
44 TALB
,*) album
=$rest have_album
=t
;;
45 TXXX
,"(MusicBrainz Album Id): "*)
46 musicbrainz_albumid
=${rest#*): }
47 have_musicbrainz_albumid
=t
54 case $have_artist,$have_album,$have_musicbrainz_albumid in
56 echo "$musicbrainz_albumid $artist | $album"