feat: Adding next song

This commit is contained in:
kar
2025-12-30 21:53:08 -06:00
parent 19e920a83f
commit 51c7ec058b
2 changed files with 12 additions and 1 deletions
+11
View File
@@ -38,6 +38,8 @@ func menuController(conn net.Conn) {
out = pauseSong(conn)
case "info":
out = infoSong(conn)
case "next":
out = nextSong(conn)
}
_, err = conn.Write([]byte(out))
if err != nil {
@@ -71,3 +73,12 @@ func infoSong(conn net.Conn) string {
}
return string(output)
}
func nextSong(conn net.Conn) string {
cmd := exec.Command("mpc", "next")
output, err := cmd.CombinedOutput()
if err != nil {
log.Println("Error al reproducir siguiente cancion", err)
}
return string(output)
}