File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ type PlaybackManager struct {
4545 wfmImageJobs [3 ]* WaveformImageJob
4646
4747 // whether autoplay tracks are currently being fetched/enqueued
48- pendingAutoplay bool
48+ pendingAutoplay bool
49+ wasLoadTrackPaused bool
4950}
5051
5152type RemotePlaybackDevice struct {
@@ -128,11 +129,18 @@ func (p *PlaybackManager) addOnTrackChangeHook() {
128129 // we need to call handleWaveformImageSongChange to ensure the waveform image is updated
129130 // for the track that is loaded paused when starting the app
130131 p .handleWaveformImageSongChange (item )
132+ p .wasLoadTrackPaused = true
131133 }
132134 })
133135
134136 p .OnSongChange (func (item mediaprovider.MediaItem , _ * mediaprovider.Track ) {
135- p .handleWaveformImageSongChange (item )
137+ if p .wasLoadTrackPaused {
138+ // if the song change was triggered by LoadTrackPaused when starting the app,
139+ // we already called handleWaveformImageSongChange in the onBeforeSongChange hook above
140+ p .wasLoadTrackPaused = false
141+ } else {
142+ p .handleWaveformImageSongChange (item )
143+ }
136144
137145 if runtime .GOOS != "windows" {
138146 return
You can’t perform that action at this time.
0 commit comments