From f0a99980b68768274d3528a512f808afcc3caa9b Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Fri, 28 May 2021 03:46:32 +0430 Subject: [PATCH] fixed issue with clearing up orphan chapters --- server/src/main/kotlin/suwayomi/tachidesk/impl/Chapter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/impl/Chapter.kt b/server/src/main/kotlin/suwayomi/tachidesk/impl/Chapter.kt index 012ab20..4682adc 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/impl/Chapter.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/impl/Chapter.kt @@ -88,7 +88,7 @@ object Chapter { // clear any orphaned chapters that are in the db but not in `chapterList` val dbChapterCount = transaction { ChapterTable.select { ChapterTable.manga eq mangaId }.count() } if (dbChapterCount > chapterCount) { // we got some clean up due - val dbChapterList = transaction { ChapterTable.select { ChapterTable.manga eq mangaId } } + val dbChapterList = transaction { ChapterTable.select { ChapterTable.manga eq mangaId }.toList() } dbChapterList.forEach { if (it[ChapterTable.chapterIndex] >= chapterList.size ||