Clear MPD state on non-0 exit from MPD song sensor
[khatus.git] / bin / khatus_controller
index c4a6cfd..72136d0 100755 (executable)
@@ -2,6 +2,15 @@
 
 /^OK/ { debug("OK line", $0) }
 
+/^ERROR in:MPD.*NON_ZERO_EXIT_CODE/ {
+    for (mpd_key in db) {
+        if (mpd_key ~ "^mpd_") {
+            delete db[mpd_key]
+        }
+    }
+    next
+}
+
 /^ERROR/ {
     debug("ERROR line", $0)
     shift()
This page took 0.027745 seconds and 4 git commands to generate.