save settings when window closing to avoid losing some settings on crash-exits

This commit is contained in:
Drew Weymouth
2024-08-20 08:00:25 -07:00
parent 389c94e7e1
commit 62803b9f09
2 changed files with 11 additions and 3 deletions
+4 -2
View File
@@ -336,16 +336,18 @@ func (a *App) DeleteServerCacheDir(serverID uuid.UUID) error {
}
func (a *App) Shutdown() {
a.Config.LocalPlayback.Volume = a.LocalPlayer.GetVolume()
a.SavePlayQueueIfEnabled()
a.SaveConfigFile()
if a.ipcServer != nil {
a.ipcServer.Shutdown(a.bgrndCtx)
}
a.MPRISHandler.Shutdown()
a.PlaybackManager.DisableCallbacks()
a.PlaybackManager.Stop() // will trigger scrobble check
a.Config.LocalPlayback.Volume = a.LocalPlayer.GetVolume()
a.cancel()
a.LocalPlayer.Destroy()
a.Config.WriteConfigFile(a.configFilePath())
}
func (a *App) SavePlayQueueIfEnabled() {