From 801568950f55baa3d96289a827d3eef0f58050a7 Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Fri, 9 Apr 2021 02:10:49 -0400 Subject: [PATCH] Fix updates sorting in recents --- .../kanade/tachiyomi/data/database/queries/RawQueries.kt | 8 ++++---- .../eu/kanade/tachiyomi/ui/recents/RecentsPresenter.kt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/queries/RawQueries.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/queries/RawQueries.kt index 688621f7f9..6b53cefe96 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/queries/RawQueries.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/queries/RawQueries.kt @@ -46,8 +46,8 @@ fun getRecentsQuery(search: String) = SELECT ${Manga.TABLE}.${Manga.COL_URL} as mangaUrl, * FROM ${Manga.TABLE} JOIN ${Chapter.TABLE} ON ${Manga.TABLE}.${Manga.COL_ID} = ${Chapter.TABLE}.${Chapter.COL_MANGA_ID} WHERE ${Manga.COL_FAVORITE} = 1 - AND ${Chapter.COL_DATE_UPLOAD} > ? - AND ${Chapter.COL_DATE_UPLOAD} < ? + AND ${Chapter.COL_DATE_FETCH} > ? + AND ${Chapter.COL_DATE_FETCH} < ? AND ${Chapter.COL_DATE_FETCH} > ${Manga.COL_DATE_ADDED} AND lower(${Manga.COL_TITLE}) LIKE '%$search%' ORDER BY ${Chapter.COL_DATE_UPLOAD} DESC @@ -80,8 +80,8 @@ fun getRecentsQueryDistinct(search: String, endless: Boolean) = SELECT ${Chapter.TABLE}.${Chapter.COL_MANGA_ID},${Chapter.TABLE}.${Chapter.COL_ID} as ${History.COL_CHAPTER_ID},MAX(${Chapter.TABLE}.${Chapter.COL_DATE_UPLOAD}) FROM ${Chapter.TABLE} JOIN ${Manga.TABLE} ON ${Manga.TABLE}.${Manga.COL_ID} = ${Chapter.TABLE}.${Chapter.COL_MANGA_ID} - WHERE ${Chapter.COL_DATE_UPLOAD} > ? - AND ${Chapter.COL_DATE_UPLOAD} < ? + WHERE ${Chapter.COL_DATE_FETCH} > ? + AND ${Chapter.COL_DATE_FETCH} < ? AND ${Chapter.COL_READ} = 0 GROUP BY ${Chapter.TABLE}.${Chapter.COL_MANGA_ID}) AS newest_chapter ON ${Chapter.TABLE}.${Chapter.COL_MANGA_ID} = newest_chapter.${Chapter.COL_MANGA_ID} diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentsPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentsPresenter.kt index f8a3ca8a82..59f510ba22 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentsPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentsPresenter.kt @@ -170,7 +170,7 @@ class RecentsPresenter( else -> emptyList() } rUpdates.forEach { - it.history.last_read = it.chapter.date_upload + it.history.last_read = it.chapter.date_fetch } val nAdditions = if (viewType < VIEW_TYPE_ONLY_HISTORY) { db.getRecentlyAdded(startCal.time, calDay.time, query, isUngrouped && !limit).executeOnIO()