From b3049ed0f6b8b8f3244b4bbfadd7895cda15f667 Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Mon, 3 Jun 2024 19:33:25 -0700 Subject: [PATCH] some fixes around saved play queue loading --- backend/app.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/app.go b/backend/app.go index 31a8970..440e579 100644 --- a/backend/app.go +++ b/backend/app.go @@ -374,6 +374,10 @@ func (a *App) LoadSavedPlayQueue() error { if len(queue.Tracks) == 0 { return nil } + if len(a.PlaybackManager.GetPlayQueue()) > 0 { + // don't restore play queue if the user has already queued new tracks + return nil + } if err := a.PlaybackManager.LoadTracks(queue.Tracks, Replace, false); err != nil { return err @@ -382,7 +386,7 @@ func (a *App) LoadSavedPlayQueue() error { // TODO: This isn't ideal but doesn't seem to cause an audible play-for-a-split-second artifact a.PlaybackManager.PlayTrackAt(queue.TrackIndex) a.PlaybackManager.Pause() - time.Sleep(75 * time.Millisecond) // MPV seek fails if run immediately after + time.Sleep(100 * time.Millisecond) // MPV seek fails if run quickly after a.PlaybackManager.SeekSeconds(queue.TimePos) } return nil