From 7c913708f24122c8899116c8e5dce2181c3e46d6 Mon Sep 17 00:00:00 2001 From: Alexander Capehart Date: Sun, 30 Oct 2022 21:29:59 -0600 Subject: [PATCH] image: make artist images sort by count Make artist images sort by count instead of by name. I've recently added a few singles in my library that have been cluttering the previous artist image algorithm with non-ideal covers. Instead of sorting by name (Which was really an artifact of the old MediaStore engine anyway), sort by the amount of songs of each album instead, which hopefully should weight images less towards singles and more towards albums (And especially albums the user likes). --- .../main/java/org/oxycblt/auxio/image/extractor/Components.kt | 3 ++- app/src/main/res/values/strings.xml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/oxycblt/auxio/image/extractor/Components.kt b/app/src/main/java/org/oxycblt/auxio/image/extractor/Components.kt index 2201eb9d1..6e07c5104 100644 --- a/app/src/main/java/org/oxycblt/auxio/image/extractor/Components.kt +++ b/app/src/main/java/org/oxycblt/auxio/image/extractor/Components.kt @@ -86,7 +86,8 @@ private constructor( private val artist: Artist ) : BaseFetcher() { override suspend fun fetch(): FetchResult? { - val albums = Sort(Sort.Mode.ByName, true).albums(artist.albums) + // Pick the "most prominent" albums (i.e albums with the most songs) to show in the image. + val albums = Sort(Sort.Mode.ByCount, false).albums(artist.albums) val results = albums.mapAtMost(4) { album -> fetchCover(context, album) } return createMosaic(context, results, size) } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 400f9afda..92e5c03d3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -170,7 +170,7 @@ Library tabs Change visibility and order of library tabs Hide collaborators - Only show artists that are directly credited on an album + Only show artists that are directly credited on an album in the library Album covers Off Fast