From 6609e4ce04fa7f9c8b61268d0c8edb127671985d Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Sun, 28 Nov 2021 19:23:52 +0800 Subject: [PATCH] fix(api): only mark unread book as read for tachiyomi readlist --- .../org/gotson/komga/interfaces/rest/ReadListController.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/rest/ReadListController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/rest/ReadListController.kt index d91c9cb79..49e286433 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/rest/ReadListController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/rest/ReadListController.kt @@ -309,7 +309,10 @@ class ReadListController( BookSearchWithReadProgress(), UnpagedSorted(Sort.by(Sort.Order.asc("readList.number"))) ).filterIndexed { index, _ -> index < readProgress.lastBookRead } - .forEach { book -> bookLifecycle.markReadProgressCompleted(book.id, principal.user) } + .forEach { book -> + if (book.readProgress?.completed != true) + bookLifecycle.markReadProgressCompleted(book.id, principal.user) + } } ?: throw ResponseStatusException(HttpStatus.NOT_FOUND) }