From dcbd7c2117fc7070bad7d569fd390122b053e554 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Tue, 16 Jan 2024 14:57:42 +0200 Subject: [PATCH] Fix history sorting --- .../main/kotlin/org/koitharu/kotatsu/history/data/HistoryDao.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/history/data/HistoryDao.kt b/app/src/main/kotlin/org/koitharu/kotatsu/history/data/HistoryDao.kt index ed2deec64..f6fdfad90 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/history/data/HistoryDao.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/history/data/HistoryDao.kt @@ -39,7 +39,7 @@ abstract class HistoryDao { ListSortOrder.NEWEST -> "history.created_at DESC" ListSortOrder.PROGRESS -> "history.percent DESC" ListSortOrder.ALPHABETIC -> "manga.title" - ListSortOrder.NEW_CHAPTERS -> "(SELECT chapters_new FROM tracks WHERE tracks.manga_id = manga.manga_id) DESC" + ListSortOrder.NEW_CHAPTERS -> "IFNULL((SELECT chapters_new FROM tracks WHERE tracks.manga_id = manga.manga_id), 0) DESC" else -> throw IllegalArgumentException("Sort order $order is not supported") }