Iken: add filter to only show accessible chapters (#6155)

This commit is contained in:
dngonz 2024-11-19 15:55:00 +01:00 committed by GitHub
parent c0b73ec32a
commit 1a6c73b5a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 2 deletions

View File

@ -2,4 +2,4 @@ plugins {
id("lib-multisrc")
}
baseVersionCode = 4
baseVersionCode = 5

View File

@ -96,10 +96,13 @@ class Chapter(
private val createdBy: Name,
private val createdAt: String,
private val chapterStatus: String,
private val isAccessible: Boolean,
private val mangaPost: ChapterPostDetails,
) {
fun isPublic() = chapterStatus == "PUBLIC"
fun isAccessible() = isAccessible
fun toSChapter(mangaSlug: String?) = SChapter.create().apply {
val seriesSlug = mangaSlug ?: mangaPost.slug
url = "/series/$seriesSlug/$slug#$id"

View File

@ -128,7 +128,7 @@ abstract class Iken(
assert(!data.post.isNovel) { "Novels are unsupported" }
return data.post.chapters
.filter { it.isPublic() }
.filter { it.isPublic() && it.isAccessible() }
.map { it.toSChapter(data.post.slug) }
}