From b3f614e150f42e856f843e07523d78989dfb1500 Mon Sep 17 00:00:00 2001 From: dasoops <66471149+dasoops@users.noreply.github.com> Date: Thu, 25 Apr 2024 19:23:11 +0800 Subject: [PATCH] Sort artists by gallery count (#1059) * Sort artists by number of galleries * Sorted in DB query --- app/src/main/kotlin/com/hippo/ehviewer/dao/DownloadsDao.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/hippo/ehviewer/dao/DownloadsDao.kt b/app/src/main/kotlin/com/hippo/ehviewer/dao/DownloadsDao.kt index 4662b508b..6756caf64 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/dao/DownloadsDao.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/dao/DownloadsDao.kt @@ -17,7 +17,7 @@ interface DownloadsDao { fun countByLabel(): Flow> @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> @Query("SELECT * FROM DOWNLOADS ORDER BY TIME")