From 21e325af9c317eaf1f43b0300bd440550d83c330 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sat, 4 Nov 2023 23:09:32 +0100 Subject: [PATCH] Correctly handle download of new chapters of not started entries (#755) The function incorrectly exited early in case no latest read chapter was found. This rendered disabling the setting "excludeEntryWithUnreadChapters" useless. --- server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Chapter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Chapter.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Chapter.kt index 4f13e719..70e60929 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Chapter.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Chapter.kt @@ -264,7 +264,7 @@ object Chapter { // make sure to only consider the latest chapters. e.g. old unread chapters should be ignored val latestReadChapterIndex = - updatedChapterList.indexOfFirst { it[ChapterTable.isRead] }.takeIf { it > -1 } ?: return + updatedChapterList.indexOfFirst { it[ChapterTable.isRead] }.takeIf { it > -1 } ?: (updatedChapterList.size - 1) val unreadChapters = updatedChapterList.subList(numberOfNewChapters, latestReadChapterIndex) .filter { !it[ChapterTable.isRead] }