mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-23 10:52:30 +01:00
Iken: add filter to only show accessible chapters (#6155)
This commit is contained in:
parent
c0b73ec32a
commit
1a6c73b5a1
@ -2,4 +2,4 @@ plugins {
|
||||
id("lib-multisrc")
|
||||
}
|
||||
|
||||
baseVersionCode = 4
|
||||
baseVersionCode = 5
|
||||
|
@ -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"
|
||||
|
@ -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) }
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user