From 6c2dfc9edc7c1fb5b23423e3091155d1def168d0 Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Sun, 6 Jul 2025 14:56:43 -0700 Subject: [PATCH] don't use GroupedReleases if all artist's releases are albums --- ui/browsing/artistpage.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/browsing/artistpage.go b/ui/browsing/artistpage.go index ab2601d..623dca5 100644 --- a/ui/browsing/artistpage.go +++ b/ui/browsing/artistpage.go @@ -2,6 +2,7 @@ package browsing import ( "log" + "slices" "sort" "strconv" @@ -299,7 +300,14 @@ func (a *ArtistPage) load() { } func (a *ArtistPage) showAlbumGrid(reSort bool) { - useGroupedReleases := a.artistInfo != nil && len(a.artistInfo.Albums) <= 50 + allAlbums := func() bool { + return slices.IndexFunc(a.artistInfo.Albums, func(al *mediaprovider.Album) bool { + return al.ReleaseTypes&mediaprovider.ReleaseTypeCompilation > 0 || + al.ReleaseTypes&mediaprovider.ReleaseTypeEP > 0 || + al.ReleaseTypes&mediaprovider.ReleaseTypeSingle > 0 + }) < 0 + } + useGroupedReleases := a.artistInfo != nil && len(a.artistInfo.Albums) <= 50 && !allAlbums() if a.albumGrid == nil && a.groupedReleases == nil { if a.artistInfo == nil {