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
+6
View File
@@ -197,6 +197,12 @@ func (d *DLNAPlayer) GetStatus() player.Status {
}
}
func (d *DLNAPlayer) Destroy() {
if d.proxyServer != nil {
go d.proxyServer.Shutdown(context.Background())
}
}
func getLocalIP() (string, error) {
interfaces, err := net.Interfaces()
if err != nil {
+2
View File
@@ -140,6 +140,8 @@ func (j *JukeboxPlayer) GetStatus() player.Status {
}
}
func (j *JukeboxPlayer) Destroy() {}
func (j *JukeboxPlayer) startAndUpdateTime() error {
beforeStart := time.Now()
if err := j.provider.JukeboxStart(); err != nil {
+2
View File
@@ -27,6 +27,8 @@ type BasePlayer interface {
GetStatus() Status
Destroy()
// Event API
OnPaused(func())
OnStopped(func())