Don't filter out partially read chapters when marking as unread
Fixes #8313
Cette révision appartient à :
Parent
401134fa8e
révision
37cb4ec0c2
1 fichiers modifiés avec 6 ajouts et 1 suppressions
|
@ -27,7 +27,12 @@ class SetReadStatus(
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun await(read: Boolean, vararg chapters: Chapter): Result = withNonCancellableContext {
|
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()) {
|
if (chaptersToUpdate.isEmpty()) {
|
||||||
return@withNonCancellableContext Result.NoChapters
|
return@withNonCancellableContext Result.NoChapters
|
||||||
}
|
}
|
||||||
|
|
Référencer dans un nouveau ticket