24 lines
465 B
Go
Raw Normal View History

2024-02-18 11:10:36 -08:00
package commands
import (
"fmt"
)
func (c *Commander) Repeat() error {
state, err := c.Client.PlayerState(c.Context)
if err != nil {
return err
}
newState := "off"
if state.RepeatState == "off" {
newState = "context"
}
// spotifyd only supports binary value for repeat, context or off, change when/if spotifyd is better
err = c.Client.Repeat(c.Context, newState)
if err != nil {
return err
}
fmt.Println("Repeat set to", newState)
return nil
}