From 55b7b8ca2a9a69e9b12625e63d4b6335b968dd3e Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 9 Apr 2020 23:30:00 -0400 Subject: [PATCH] Reducing New chapters fetch on recents to a week instead of a month --- .../kanade/tachiyomi/ui/recents/RecentsPresenter.kt | 11 ++++++++--- 1 file changed, 8 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 8fa90be2b1..04994ab752 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 @@ -59,16 +59,21 @@ class RecentsPresenter( val calWeek = Calendar.getInstance() calWeek.time = Date() if (query.isNotEmpty()) calWeek.add(Calendar.YEAR, -50) - else calWeek.add(Calendar.DAY_OF_YEAR, -1) + else calWeek.add(Calendar.WEEK_OF_MONTH, -1) + + val calDay = Calendar.getInstance() + calDay.time = Date() + if (query.isNotEmpty()) calDay.add(Calendar.YEAR, -50) + else calDay.add(Calendar.DAY_OF_YEAR, -1) val cReading = if (query.isEmpty()) db.getRecentsWithUnread(cal.time, query).executeOnIO() else db.getRecentMangaLimit(cal.time, 8, query).executeOnIO() - val rUpdates = db.getUpdatedManga(cal.time, query).executeOnIO() + val rUpdates = db.getUpdatedManga(calWeek.time, query).executeOnIO() rUpdates.forEach { it.history.last_read = it.chapter.date_fetch } - val nAdditions = db.getRecentlyAdded(calWeek.time, query).executeOnIO() + val nAdditions = db.getRecentlyAdded(calDay.time, query).executeOnIO() nAdditions.forEach { it.history.last_read = it.manga.date_added }