From 70279c4c62ae4180706c0d27c5bbcf275c903100 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 21 May 2023 21:24:27 +0200 Subject: continue playback when adding a song to an empty queue Now WRMS only switches the playback state when an admin calls the /playpause endpoint. When the queue runs out of songs the state is kept and continues when a new song is added. --- player.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'player.go') diff --git a/player.go b/player.go index f8f6272..e7d1dd9 100644 --- a/player.go +++ b/player.go @@ -68,13 +68,11 @@ func (player *Player) runMpv() { wrms := player.wrms - llog.Info("mpv finished. Resetting mpv, the current song and call play") + llog.Info("mpv finished. Resetting mpv, and calling next") player.mpv = nil - wrms.Playing = false player.Backends[wrms.CurrentSong.Source].OnSongFinished(&wrms.CurrentSong) - wrms.CurrentSong.Uri = "" - wrms.PlayPause() + wrms.Next() } func (player *Player) PlayUri(uri string) { -- cgit v1.2.3