shutdown proxy server when switching back to local; debounce vol slider

This commit is contained in:
Drew Weymouth
2025-03-29 15:15:13 -07:00
parent 5a37b1e39f
commit e5c8027a82
5 changed files with 35 additions and 0 deletions
+4
View File
@@ -9,6 +9,7 @@ import (
"github.com/dweymouth/supersonic/backend/mediaprovider"
"github.com/dweymouth/supersonic/backend/player"
"github.com/dweymouth/supersonic/backend/player/mpv"
"github.com/dweymouth/supersonic/backend/util"
"github.com/dweymouth/supersonic/sharedutil"
)
@@ -154,6 +155,9 @@ func (p *playbackEngine) SetPlayer(pl player.BasePlayer) {
}
oldVol := p.player.GetVolume()
if _, isMPV := p.player.(*mpv.Player); !isMPV {
p.player.Destroy()
}
p.player = pl
p.registerPlayerCallbacks(pl)