Use newer mpd API
authorSiraaj Khandkar <siraaj@khandkar.net>
Fri, 8 Feb 2019 03:33:00 +0000 (22:33 -0500)
committerSiraaj Khandkar <siraaj@khandkar.net>
Fri, 8 Feb 2019 03:33:00 +0000 (22:33 -0500)
x2/src/bash/exe/khatus_sensor_mpd.sh

index 058cecd..dab4d77 100644 (file)
@@ -4,6 +4,18 @@ set -e
 
 dir_bin="$1"
 
-echo 'status\ncurrentsong' \
+# TODO: Convert mpd sensor to watcher from poller
+#       Since we can just open the connection and send periodic requests.
+#
+# close
+#     Closes the connection to MPD. MPD will try to send the remaining output
+#     buffer before it actually closes the connection, but that cannot be
+#     guaranteed. This command will not generate a response.
+#
+#     Clients should not use this command; instead, they should just close the socket.
+#
+# https://www.musicpd.org/doc/html/protocol.html#connection-settings
+#
+echo 'status\ncurrentsong\nclose' \
 | nc 127.0.0.1 6600 \
 | "$dir_bin"/khatus_parse_mpd_status_currentsong
This page took 0.033038 seconds and 4 git commands to generate.