Skip to content

Commit db5f8ac

Browse files
committed
Display repeat/shuffle result message
1 parent 3ba81ca commit db5f8ac

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

smudge-connect.el

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,24 @@ Returns a JSON string in the format:
148148
(smudge-connect-when-device-active
149149
(smudge-api-get-player-status
150150
(lambda (status)
151-
(smudge-api-repeat (if (smudge-connect--is-repeating status) "off" "context"))))))
151+
(let ((is-repeating (smudge-connect--is-repeating status)))
152+
(smudge-api-repeat (if is-repeating "off" "context")
153+
(lambda (_)
154+
(if is-repeating
155+
(message "Repeat turned off")
156+
(message "Repeat turned on")))))))))
152157

153158
(defun smudge-connect-toggle-shuffle ()
154159
"Toggle shuffle for the current track."
155160
(smudge-connect-when-device-active
156161
(smudge-api-get-player-status
157162
(lambda (status)
158-
(smudge-api-shuffle (if (smudge-connect--is-shuffling status) "false" "true"))))))
163+
(let ((is-shuffling (smudge-connect--is-shuffling status)))
164+
(smudge-api-shuffle (if is-shuffling "false" "true")
165+
(lambda (_)
166+
(if is-shuffling
167+
(message "Shuffling turned off")
168+
(message "Shuffling turned on")))))))))
159169

160170
(defun smudge-connect-get-device-id (player-status)
161171
"Get the id if from PLAYER-STATUS of the currently playing device, if any."

0 commit comments

Comments
 (0)