now playing page can remove tracks from play queue

This commit is contained in:
Drew Weymouth
2023-02-11 13:07:02 -08:00
parent 7d5677057c
commit b667e2cd07
3 changed files with 49 additions and 2 deletions
+8
View File
@@ -131,6 +131,14 @@ func (p *Player) PlayFile(url string) error {
return err
}
// Removes the item at the given index from the internal playqueue.
func (p *Player) RemoveTrackAt(idx int) error {
if p.mpv == nil {
return ErrUnitialized
}
return p.mpv.Command([]string{"playlist-remove", strconv.Itoa(idx)})
}
// Stops playback and clears the play queue.
func (p *Player) Stop() error {
if p.mpv == nil {