[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#62298] [PATCH v2 5/8] services: mpd: Fix unintentional API breakage
From: |
Bruno Victal |
Subject: |
[bug#62298] [PATCH v2 5/8] services: mpd: Fix unintentional API breakage for mixer-type field. |
Date: |
Thu, 23 Mar 2023 15:02:15 +0000 |
* gnu/services/audio.scm (mpd-output)[mixer-type]: Use sanitizer to
accept both strings and symbols as values.
---
gnu/services/audio.scm | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
index e5b065a479..56ea2f8638 100644
--- a/gnu/services/audio.scm
+++ b/gnu/services/audio.scm
@@ -140,6 +140,11 @@ (define (uglify-field-name field-name)
(define list-of-symbol?
(list-of symbol?))
+
+;;;
+;;; MPD
+;;;
+
(define (mpd-serialize-field field-name value)
(let ((field (if (string? field-name) field-name
(uglify-field-name field-name)))
@@ -294,7 +299,17 @@ (define-configuration mpd-output
for this audio output: the @code{hardware} mixer, the @code{software}
mixer, the @code{null} mixer (allows setting the volume, but with no
effect; this can be used as a trick to implement an external mixer
-External Mixer) or no mixer (@code{none}).")
+External Mixer) or no mixer (@code{none})."
+ (sanitizer
+ (lambda (x) ; TODO: deprecated, remove me later.
+ (cond
+ ((symbol? x)
+ (warning (G_ "symbol value for 'mixer-type' is deprecated, \
+use string instead~%"))
+ (symbol->string x))
+ ((string? x) x)
+ (else
+ (configuration-field-error #f 'mixer-type x))))))
(replay-gain-handler
maybe-string
--
2.39.1
- [bug#62298] [PATCH v2 3/8] services: audio: remove redundant list-of-string? predicate., (continued)
- [bug#62298] [PATCH v2 3/8] services: audio: remove redundant list-of-string? predicate., Bruno Victal, 2023/03/23
- [bug#62298] [PATCH v2 8/8] services: mympd: Use user-account (resp. user-group) for user (resp. group) fields., Bruno Victal, 2023/03/23
- [bug#62298] [PATCH v2 8/8] services: mympd: Use user-account (resp. user-group) for user (resp. group) fields., Maxim Cournoyer, 2023/03/24
- [bug#62298] [PATCH v2 8/8] services: mympd: Use user-account (resp. user-group) for user (resp. group) fields., Bruno Victal, 2023/03/24
- [bug#62298] [PATCH v2 8/8] services: mympd: Use user-account (resp. user-group) for user (resp. group) fields., Liliana Marie Prikler, 2023/03/25
[bug#62298] [PATCH v2 7/8] services: mpd: Use user-account (resp. user-group) for user (resp. group) fields., Bruno Victal, 2023/03/23
[bug#62298] [PATCH v2 5/8] services: mpd: Fix unintentional API breakage for mixer-type field.,
Bruno Victal <=
[bug#62298] [PATCH v2 1/8] services: configuration: Add user-defined sanitizer support., Liliana Marie Prikler, 2023/03/23
[bug#62298] [PATCH v2 1/8] services: configuration: Add user-defined sanitizer support., Maxim Cournoyer, 2023/03/24
[bug#62298] [PATCH v3 1/5] services: configuration: Add user-defined sanitizer support., Bruno Victal, 2023/03/24
[bug#62298] [PATCH v4 1/5] services: configuration: Add user-defined sanitizer support., Bruno Victal, 2023/03/26