Prioritize finding selected chapter when deduping reader chapters
Fixes #9054
This commit is contained in:
parent
34a586ce48
commit
23432e4405
1 changed files with 4 additions and 3 deletions
|
@ -177,10 +177,11 @@ class ReaderViewModel(
|
||||||
}.run {
|
}.run {
|
||||||
if (readerPreferences.skipDupe().get()) {
|
if (readerPreferences.skipDupe().get()) {
|
||||||
groupBy { it.chapterNumber }
|
groupBy { it.chapterNumber }
|
||||||
.mapValues { (_, chapters) ->
|
.map { (_, chapters) ->
|
||||||
chapters.find { it.id == chapterId || it.scanlator == selectedChapter.scanlator } ?: chapters.first()
|
chapters.find { it.id == selectedChapter.id }
|
||||||
|
?: chapters.find { it.scanlator == selectedChapter.scanlator }
|
||||||
|
?: chapters.first()
|
||||||
}
|
}
|
||||||
.values
|
|
||||||
} else {
|
} else {
|
||||||
this
|
this
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue