Don't filter out partially read chapters when marking as unread

Fixes #8313

(cherry picked from commit 37cb4ec0c22d9b020afa473e593a074e2b8d5694)
This commit is contained in:
arkon 2022-10-28 18:29:00 -04:00 committed by Jobobby04
parent e1f841e78a
commit 250955a0f1

View File

@ -31,7 +31,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
}