getInfos::APE() (raw and experimental)

This commit is contained in:
Vincent Riquer 2013-03-05 13:46:38 +01:00
parent 000f953ee7
commit 56aa66ba25

61
atom
View File

@ -732,7 +732,66 @@ getInfos::FLAC() {
} }
getInfos::APE() { getInfos::APE() {
: # I was not able to find a decent cli tool to read APE tags.
# This is raw but works for the very few MusePack files I got.
#
# Please tell me if you know of any good tool.
IFS='='
while read tag value
do
IFS="$oldIFS"
case $tag in
[Aa][Ll][Bb][Uu][Mm]' '[Aa][Rr][Tt][Ii][Ss][Tt])
albumartist="$value"
;;
[Aa][Rr][Tt][Ii][Ss][Tt])
artist="$value"
;;
[Yy][Ee][Aa][Rr])
date="$value"
;;
[Aa][Ll][Bb][Uu][Mm])
album="$value"
;;
[Tt][Ii][Tt][Ll][Ee])
title="$value"
;;
[Tt][Rr][Aa][Cc][Kk])
track="$value"
;;
[Gg][Ee][Nn][Rr][Ee])
genre="$value"
;;
[Cc][Oo][Mm][Pp][Oo][Ss][Ee][Rr])
composer="$value"
;;
[Pp][Ee][Rr][Ff][Oo][Rr][Mm][Ee][Rr])
performer="$value"
;;
*)
;;
esac
IFS='='
done < <(
IFS="$oldIFS"
sed \
's/APETAGEX/\n/;s/[\x00\-\x1F]\x00\+/\n/g;s/\x00/=/g' \
"$1" \
| egrep -i \
'^(Album Artist|Artist|Year|Album|Title|Track|Genre|Composer|Performer)='
)
IFS="$oldIFS"
[ -n "$album" \
-o -n "$albumartist" \
-o -n "$artist" \
-o -n "$composer" \
-o -n "$disc" \
-o -n "$genre" \
-o -n "$performer" \
-o -n "$title" \
-o -n "$tracknum" \
-o -n "$year" ] \
|| return 1
} }
getTags() { getTags() {