mirror of
https://github.com/null2264/yokai.git
synced 2025-06-20 18:24:42 +00:00
fix: Fix mark existing duplicate read chapters as read option not working in some cases
This commit is contained in:
parent
7964ac87c6
commit
18528fbd92
1 changed files with 8 additions and 3 deletions
|
@ -67,6 +67,7 @@ import kotlinx.coroutines.flow.onEach
|
|||
import kotlinx.coroutines.flow.receiveAsFlow
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.withContext
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
@ -156,6 +157,11 @@ class ReaderViewModel(
|
|||
private var finished = false
|
||||
private var chapterToDownload: Download? = null
|
||||
|
||||
private val unfilteredChapterList by lazy {
|
||||
val manga = manga!!
|
||||
runBlocking { getChapter.awaitAll(manga, filterScanlators = false) }
|
||||
}
|
||||
|
||||
private lateinit var chapterList: List<ReaderChapter>
|
||||
|
||||
private var chapterItems = emptyList<ReaderChapterItem>()
|
||||
|
@ -639,9 +645,8 @@ class ReaderViewModel(
|
|||
.contains(LibraryPreferences.MARK_DUPLICATE_READ_CHAPTER_READ_EXISTING)
|
||||
if (!markDuplicateAsRead) return
|
||||
|
||||
val duplicateUnreadChapters = chapterList
|
||||
.mapNotNull {
|
||||
val chapter = it.chapter
|
||||
val duplicateUnreadChapters = unfilteredChapterList
|
||||
.mapNotNull { chapter ->
|
||||
if (
|
||||
!chapter.read &&
|
||||
chapter.isRecognizedNumber &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue