Checkpoint

This commit is contained in:
maze authored and maze committed 2026-10-29 17:28:51 +01:00
1 parent 7b6db17870
commit 0295eb1ad2
125 files changed
+59376

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
package main
import (
"github.com/sirupsen/logrus"
bragi "git.maze.io/go/bragi"
)
func main() {
logrus.SetLevel(logrus.DebugLevel)
s := bragi.NewMPD("volumio.local:6600")
log := logrus.WithField("source", s.Name())
log.Info("created source")
for e := range s.Events() {
switch e := e.(type) {
case *bragi.ConnectedEvent:
log.Info("connected")
case *bragi.DisconnectedEvent:
log.Info("disconnected")
case *bragi.StatusEvent:
t := e.Status.Track
if t != nil {
logrus.
WithField("track", t).
WithField("file", t.Path).
Info("received track")
}
default:
log.WithField("event", e).Info("received event")
}
}
}