diff --git a/.gitignore b/.gitignore index aca1950..9e9a72e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +sanic result # Created by https://www.toptal.com/developers/gitignore/api/linux,windows,macos,vim,goland+all,go,direnv diff --git a/mpd.go b/mpd.go deleted file mode 100644 index cc76926..0000000 --- a/mpd.go +++ /dev/null @@ -1,60 +0,0 @@ -package main - -import ( - "fmt" - "github.com/fhs/gompd/v2/mpd" - "log" - "time" -) - -func main() { - w, err := mpd.NewWatcher("tcp", ":6600", "") - if err != nil { - log.Fatalln(err) - } - defer w.Close() - - // Log errors. - go func() { - for err := range w.Error { - log.Println("Error:", err) - } - }() - - // Log events. - go func() { - for subsystem := range w.Event { - log.Println("Changed subsystem:", subsystem) - } - }() - - // Do other stuff... - time.Sleep(3 * time.Minute) -} - -func main2() { - // Connect to MPD server - conn, err := mpd.Dial("tcp", "localhost:6600") - if err != nil { - log.Fatalln(err) - } - defer conn.Close() - - // Loop printing the current status of MPD - for { - status, err := conn.Status() - if err != nil { - log.Fatalln(err) - } - song, err := conn.CurrentSong() - if err != nil { - log.Fatalln(err) - } - if status["state"] == "play" { - fmt.Println(fmt.Sprintf("%s - %s", song["Artist"], song["Title"])) - } else { - fmt.Println(fmt.Sprintf("State: %s", status["state"])) - } - time.Sleep(1 * time.Second) - } -} diff --git a/static/index.html b/static/index.html index d55d047..33702d8 100644 --- a/static/index.html +++ b/static/index.html @@ -4,62 +4,16 @@ sanic :: paused - - - +
-
-
- -
+ + + +
-
+
@@ -95,7 +62,7 @@ thead {
-
+
@@ -150,10 +117,10 @@ thead {
-