2 Commits

Author SHA1 Message Date
e425b08ef8 added ShufflePlaylist 2025-06-28 15:33:45 +02:00
f413f97824 added GetPlaylistPosition 2025-06-28 14:18:56 +02:00
2 changed files with 10 additions and 0 deletions

View File

@ -23,6 +23,12 @@ func LoadFile(socket string, file string, flags LoadFileFlag) error {
return err
}
func ShufflePlaylist(socket string) error {
cmd := &Command{Command: []interface{}{"playlist-shuffle"}}
_, err := SendCommand[any](socket, cmd)
return err
}
func Quit(socket string) error {
cmd := &Command{Command: []interface{}{"quit"}}
_, err := SendCommand[any](socket, cmd)

View File

@ -57,6 +57,10 @@ func GetPause(socket string) (bool, error) {
return GetProperty[bool](socket, "pause")
}
func GetPlaylistPosition(socket string) (int, error) {
return GetProperty[int](socket, "playlist-pos")
}
func GetDuration(socket string) (time.Duration, error) {
durationInSeconds, err := GetProperty[float64](socket, "duration")
if err != nil {