fix(api): only mark unread book as read for tachiyomi readlist

This commit is contained in:
Gauthier Roebroeck 2021-11-28 19:23:52 +08:00
parent 884573e20d
commit 6609e4ce04

View file

@ -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)
}