#!/usr/bin/env zsh
cat <<EOF
-%rec: Album
-%mandatory: Artist Album
-%allowed: Year Collection Lossless
-%type: Year int
-%type: Lossless bool
+%rec: album
+%mandatory: artist album
+%allowed: year col lossless
+%type: year int
+%type: lossless bool
EOF
album=(${ts[2,-1]})
}
lossless=""
- [[ -d $name ]] && {
+ if [[ -d $name ]] ; then
wvs=($name/**/*.wv(N))
[[ ${#wvs} -gt 0 ]] && lossless=1
- } || {
+ else
[[ $name:e = wv ]] && lossless=1
- }
+ fi
cols=()
for col ($COLS) [[ -e cols/$col/$name ]] && cols=($cols $col)
- print "Artist: ${(j/-/)artist:gs/_/ /}"
- [[ -n $year ]] && print "Year: $year"
- print "Album: ${(j/-/)album:gs/_/ /}"
- [[ -n $lossless ]] && print "Lossless: yes"
- for col ($cols) print "Collection: $col"
- [[ ${#cols} -eq 0 ]] && print "Collection: unsorted"
+ print "artist: ${(j/-/)artist:gs/_/ /}"
+ [[ -n $year ]] && print "year: $year"
+ print "album: ${(j/-/)album:gs/_/ /}"
+ [[ -n $lossless ]] && print "lossless: yes"
+ for col ($cols) print "col: $col"
print
}