From 37cb4ec0c22d9b020afa473e593a074e2b8d5694 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 28 Oct 2022 18:29:00 -0400 Subject: [PATCH] Don't filter out partially read chapters when marking as unread Fixes #8313 --- .../eu/kanade/domain/chapter/interactor/SetReadStatus.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/SetReadStatus.kt b/app/src/main/java/eu/kanade/domain/chapter/interactor/SetReadStatus.kt index ed196965c..21199cf3b 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/interactor/SetReadStatus.kt +++ b/app/src/main/java/eu/kanade/domain/chapter/interactor/SetReadStatus.kt @@ -27,7 +27,12 @@ class SetReadStatus( } suspend fun await(read: Boolean, vararg chapters: Chapter): Result = withNonCancellableContext { - val chaptersToUpdate = chapters.filterNot { it.read == read } + val chaptersToUpdate = chapters.filter { + when (read) { + true -> !it.read + false -> it.read || it.lastPageRead > 0 + } + } if (chaptersToUpdate.isEmpty()) { return@withNonCancellableContext Result.NoChapters }