From d81fafc9f636175069785555e20ed4bcb8468a29 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sat, 23 Sep 2023 22:25:59 +0200 Subject: [PATCH] Correctly detect initial fetch of chapters (#689) Since the number of chapters gets converted to be index based, 1 available chapter would result in 0. Due to this, in case a manga had exactly one chapter before updating the chapters, it was incorrectly detected as the initial fetch and the new chapters did not get automatically downloaded. --- 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 21e8093c..9cf2f905 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Chapter.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Chapter.kt @@ -210,7 +210,7 @@ object Chapter { val numberOfNewChapters = updatedNumberOfChapters - currentNumberOfChapters val areNewChaptersAvailable = numberOfNewChapters > 0 - val wasInitialFetch = currentNumberOfChapters == 0 + val wasInitialFetch = currentNumberOfChapters == -1 // has to be -1 - due to converting to index based 1 chapter will be 0 // make sure to ignore initial fetch val isDownloadPossible =