Open a requested chapter in the reader even if its scanlator is excluded by filter

The reader builds its chapter list with excluded scanlators filtered out, so a chapter opened directly (from a deep link or a notification) whose scanlator is excluded wasn't in the list and failed to open. The requested chapter is now added back when the filter removed it.
This commit is contained in:
AntsyLich
2026-09-27 22:56:42 +06:00
parent 553762fae8
commit 2b4b8472bb
@@ -202,6 +202,13 @@ class ReaderViewModel(
private val chapterList by lazy {
val manga = manga!!
val chapters = runBlocking { getChaptersByMangaId.await(manga.id, applyScanlatorFilter = true) }
.let { filtered ->
if (filtered.any { it.id == chapterId }) {
filtered
} else {
filtered + unfilteredChapterList.filter { it.id == chapterId }
}
}
val selectedChapter = chapters.find { it.id == chapterId }
?: error("Requested chapter of id $chapterId not found in chapter list")