]> Sergey Matveev's repositories - dotfiles.git/blobdiff - bin/bin/music-indexer
link-for-vk
[dotfiles.git] / bin / bin / music-indexer
index 9c1d5d106d06bf404d8c0b0e18f7fa894820c2d5..3a6bc9665f321cff66fdca26d837b02f06834ebf 100755 (executable)
@@ -1,11 +1,11 @@
 #!/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
 
@@ -29,20 +29,19 @@ for name (*~cols) {
         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
 }