summaryrefslogtreecommitdiff
path: root/gnu/services/audio.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-04-25 17:28:21 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-07-25 13:04:17 -0400
commite1070ee16036f6dfb84c44aea4119e4db770356b (patch)
tree66833da2d1907d19f69ec70f780b1da001e3ad45 /gnu/services/audio.scm
parent6a57bf96128a35b500f640784a36d0d1fa8a5466 (diff)
services: mpd: Add an 'update' action to trigger a database update.
* gnu/services/audio.scm (mpd-shepherd-service): Register a new update action. * doc/guix.texi (Audio Services): Document it.
Diffstat (limited to 'gnu/services/audio.scm')
-rw-r--r--gnu/services/audio.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
index 8c061da47f..6e4ce3f9fb 100644
--- a/gnu/services/audio.scm
+++ b/gnu/services/audio.scm
@@ -620,6 +620,17 @@ appended to the configuration.")
(format #t
"Issued SIGHUP to Service MPD (PID ~a)."
pid))
+ (format #t "Service MPD is not running.")))))
+ (shepherd-action
+ (name 'update)
+ (documentation "Request MPD to update its music database.")
+ (procedure
+ #~(lambda (pid)
+ (if pid
+ (begin
+ (invoke #$(file-append mpd-mpc "/bin/mpc") "update")
+ (format #t "Database update requested for service \
+MPD (PID ~a)." pid))
(format #t "Service MPD is not running.")))))))))))
(define (mpd-accounts config)