add album page showing track listing

This commit is contained in:
Drew Weymouth
2023-01-02 18:05:13 -08:00
parent e309a5ad7f
commit 632df5c1b2
10 changed files with 140 additions and 36 deletions
+10
View File
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"strconv"
"github.com/wildeyedskies/go-mpv/mpv"
)
@@ -226,6 +227,15 @@ func (p *Player) PlayFromBeginning() error {
return err
}
// Start playback from the specified track index in the play queue.
func (p *Player) PlayTrackAt(idx int) error {
err := p.mpv.Command([]string{"playlist-play-index", strconv.Itoa(idx)})
if err == nil {
p.setState(Playing)
}
return err
}
// Begins playback if there is anything in the play queue and player is stopped or paused.
// If player is playing, pauses playback.
func (p *Player) PlayPause() error {