clear Mac media center metadata on stopped

This commit is contained in:
Drew Weymouth
2023-10-22 16:30:44 -07:00
parent bf93689bce
commit 4f74b041b7
5 changed files with 46 additions and 53 deletions
+4
View File
@@ -367,6 +367,10 @@ func (p *Player) PlayFromBeginning() error {
// Start playback from the specified track index in the play queue.
func (p *Player) PlayTrackAt(idx int) error {
// check if we have anything to play
if c, err := p.getInt64Property("playlist-count"); err == nil && c <= int64(idx) {
return nil
}
err := p.mpv.Command([]string{"playlist-play-index", strconv.Itoa(idx)})
if p.GetStatus().State == Paused {
err = p.setPaused(false)