Sort artists by gallery count (#1059)

* Sort artists by number of galleries

* Sorted in DB query
This commit is contained in:
dasoops authored and GitHub committed 2024-04-25 11:23:11 +00:00
1 parent 988fae56fd
commit b3f614e150
1 file changed
+1 -1
@@ -17,7 +17,7 @@ interface DownloadsDao {
fun countByLabel(): Flow<Map<@MapColumn("LABEL") String?, @MapColumn("COUNT") Int>>
@Suppress("ktlint:standard:annotation")
@Query("SELECT ARTIST, COUNT(*) AS COUNT FROM DOWNLOADS LEFT JOIN DOWNLOAD_ARTISTS USING(GID) GROUP BY ARTIST ORDER BY ARTIST")
@Query("SELECT ARTIST, COUNT(*) AS COUNT FROM DOWNLOADS LEFT JOIN DOWNLOAD_ARTISTS USING(GID) GROUP BY ARTIST ORDER BY COUNT DESC, ARTIST")
fun countByArtist(): Flow<Map<@MapColumn("ARTIST") String?, @MapColumn("COUNT") Int>>
@Query("SELECT * FROM DOWNLOADS ORDER BY TIME")