From 28236ee08c52b3e78e7ab99b9c9d31fc44a007c4 Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Thu, 16 Feb 2023 18:02:34 -0800 Subject: [PATCH] make shuffle and favorite button callbacks non-blocking --- ui/browsing/albumpage.go | 4 ++-- ui/browsing/playlistpage.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/browsing/albumpage.go b/ui/browsing/albumpage.go index 12b7dd9..e37e979 100644 --- a/ui/browsing/albumpage.go +++ b/ui/browsing/albumpage.go @@ -182,10 +182,10 @@ func NewAlbumPageHeader(page *AlbumPage) *AlbumPageHeader { page.onPlayTrackAt(0) }) shuffleBtn := widget.NewButtonWithIcon(" Shuffle", res.ResShuffleInvertSvg, func() { - page.pm.LoadAlbum(page.albumID, false, true) + page.pm.LoadTracks(page.tracklist.Tracks, false, true) page.pm.PlayFromBeginning() }) - a.toggleFavButton = widgets.NewFavoriteButton(a.toggleFavorited) + a.toggleFavButton = widgets.NewFavoriteButton(func() { go a.toggleFavorited() }) // Todo: there's got to be a way to make this less convoluted. Custom layout? a.container = container.NewBorder(nil, nil, a.cover, nil, diff --git a/ui/browsing/playlistpage.go b/ui/browsing/playlistpage.go index 9b42426..1a70ea6 100644 --- a/ui/browsing/playlistpage.go +++ b/ui/browsing/playlistpage.go @@ -165,7 +165,7 @@ func NewPlaylistPageHeader(page *PlaylistPage) *PlaylistPageHeader { }) // TODO: find way to pad shuffle svg rather than using a space in the label string shuffleBtn := widget.NewButtonWithIcon(" Shuffle", res.ResShuffleInvertSvg, func() { - page.pm.LoadPlaylist(page.playlistID, false /*append*/, true /*shuffle*/) + page.pm.LoadTracks(page.tracklist.Tracks, false /*append*/, true /*shuffle*/) page.pm.PlayFromBeginning() })