make sure calls to server are async in UI callbacks; fix genre page not playing albums regression

This commit is contained in:
Drew Weymouth
2023-02-16 17:55:33 -08:00
parent aa2204b88f
commit 941012b7d2
9 changed files with 72 additions and 70 deletions
+4 -3
View File
@@ -51,11 +51,12 @@ func NewArtistsGenresPage(isGenresPage bool, sm *backend.ServerManager, nav func
}
}
a.buildContainer()
go a.loadAsync()
go a.load()
return a
}
func (a *ArtistsGenresPage) loadAsync() {
// should be called asynchronously
func (a *ArtistsGenresPage) load() {
if a.isGenresPage {
genres, err := a.sm.Server.GetGenres()
if err != nil {
@@ -80,7 +81,7 @@ func (a *ArtistsGenresPage) Route() Route {
}
func (a *ArtistsGenresPage) Reload() {
go a.loadAsync()
go a.load()
}
func (a *ArtistsGenresPage) Save() SavedPage {