wrapping functions in a goroutine and adding OnDownload handler to the playlist grid view

This commit is contained in:
natilou
2023-06-20 13:24:37 -03:00
parent 0dfbe685e1
commit 225d439729
2 changed files with 22 additions and 8 deletions
+10
View File
@@ -113,6 +113,16 @@ func (a *PlaylistsPage) createGridView(playlists []*mediaprovider.Playlist) {
a.contr.DoAddTracksToPlaylistWorkflow(sharedutil.TracksToIDs(pl.Tracks))
}()
}
a.gridView.OnDownload = func(id string) {
go func() {
pl, err := a.contr.App.ServerManager.Server.GetPlaylist(id)
if err != nil {
log.Printf("error loading playlist: %s", err.Error())
return
}
a.contr.ShowDownloadDialog(pl.Tracks)
}()
}
}
func (a *PlaylistsPage) showListView() {