summaryrefslogtreecommitdiffstats
path: root/mpd-random-albums
diff options
context:
space:
mode:
Diffstat (limited to 'mpd-random-albums')
-rwxr-xr-xmpd-random-albums7
1 files changed, 4 insertions, 3 deletions
diff --git a/mpd-random-albums b/mpd-random-albums
index 4bcd680..50e6f79 100755
--- a/mpd-random-albums
+++ b/mpd-random-albums
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
# -*- mode: scheme; -*-
IFS=" "
-exec scsh -s "$0" "$@"
+exec scsh -ll mpd.scm -o mpd -s "$0" "$@"
!#
(define (randomize-all-albums)
@@ -12,8 +12,9 @@ exec scsh -s "$0" "$@"
(define (randomize-albums-by-artist artist)
(for-each (lambda (album)
- (display (run/string (mpc findadd ,(string-append "((artist == \"" artist "\") AND (album == \"" album "\"))")))))
- (run/strings (pipe (mpc list album ,(string-append "((artist == \"" artist "\"))"))
+ (run (mpc findadd ,(query (and (= artist ,artist)
+ (= album ,album))))))
+ (run/strings (pipe (mpc list album ,(query (= artist ,artist)))
(shuf)))))
(run (mpc clear)