From ca07d3dbb3978c86ff2410515d5f236a9f7f0f07 Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Thu, 8 Apr 2021 20:47:58 -0400 Subject: [PATCH] Fix update sorting + swiping away items not updating in some cases said case being swiping as read after another page of content loads --- .../java/eu/kanade/tachiyomi/ui/recents/RecentsPresenter.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 cfc87da17d..1d348c65c0 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 @@ -169,7 +169,7 @@ class RecentsPresenter( else -> emptyList() } rUpdates.forEach { - it.history.last_read = it.chapter.date_fetch + it.history.last_read = it.chapter.date_upload } val nAdditions = if (viewType < VIEW_TYPE_ONLY_HISTORY) { db.getRecentlyAdded(startCal.time, calDay.time, query, isUngrouped && !limit).executeOnIO() @@ -183,7 +183,7 @@ class RecentsPresenter( }.distinctBy { if (query.isEmpty() && viewType != VIEW_TYPE_ONLY_HISTORY) it.manga.id else it.chapter.id }.filter { mch -> - if (page > 0 && query.isEmpty()) { + if (updatePageCount && page > 0 && query.isEmpty()) { if (viewType != VIEW_TYPE_ONLY_HISTORY) { recentItems.none { mch.manga.id == it.mch.manga.id } } else { @@ -261,7 +261,7 @@ class RecentsPresenter( } } else pairs.map { RecentMangaItem(it.first, it.second, null) } } - recentItems = if (page == 0) { + recentItems = if (page == 0 || !updatePageCount) { newItems } else { recentItems + newItems