diff --git a/atom b/atom index 885ca6f..44d73d6 100755 --- a/atom +++ b/atom @@ -640,14 +640,42 @@ getInfos::FLAC() { : } -getInfos::MPC() { +getInfos::APE() { : } getTags() { - #getType - #getInfos:: - : + unset type + case "$mimetype" in + audio/mpeg) + type=MP3 + ;; + application/ogg) + type=Ogg + ;; + audio/x-flac) + type=FLAC + ;; + *) + extendedtype=$(file -b "$sourcepath/$filename") + case "$extendedtype" in + *' ID3 '*) + type=MP3 + ;; + *) + grep -q 'APETAGEX' \ + "$sourcepath/$filename" \ + && type=APE + ;; + esac + ;; + esac + if [ -n "$type" ] + then + getInfos::$type || return 1 + else + return 1 + fi } encodeFile::MP3() {