Bakkin: parse chapter numbers (#12708)
This commit is contained in:
parent
680dd09892
commit
08a5a14915
|
@ -8,7 +8,7 @@ class BakkinGenerator : ThemeSourceGenerator {
|
|||
|
||||
override val themeClass = "BakkinReaderX"
|
||||
|
||||
override val baseVersionCode = 4
|
||||
override val baseVersionCode = 5
|
||||
|
||||
override val sources = listOf(
|
||||
SingleLang("Bakkin", "https://bakkin.moe/reader/", "en"),
|
||||
|
|
|
@ -10,7 +10,12 @@ internal data class Series(
|
|||
val volumes: List<Volume>
|
||||
) : Iterable<Chapter> {
|
||||
override fun iterator() = volumes.flatMap { vol ->
|
||||
vol.map { it.copy("$dir/${vol.dir}/${it.dir}", "$vol - $it") }
|
||||
vol.map {
|
||||
it.copy(
|
||||
name = "$vol - $it",
|
||||
dir = "$dir/${vol.dir}/${it.dir}"
|
||||
)
|
||||
}
|
||||
}.iterator()
|
||||
|
||||
val cover: String
|
||||
|
@ -34,5 +39,8 @@ internal data class Chapter(
|
|||
val name: String,
|
||||
val pages: List<String>
|
||||
) : Iterable<String> by pages {
|
||||
val number: Float
|
||||
get() = dir.substringAfterLast('c').toFloatOrNull() ?: -1f
|
||||
|
||||
override fun toString() = name.ifEmpty { dir }
|
||||
}
|
||||
|
|
|
@ -99,11 +99,11 @@ abstract class BakkinReaderX(
|
|||
|
||||
override fun fetchChapterList(manga: SManga) =
|
||||
observableSeries { series ->
|
||||
series.first { it.dir == manga.url }.mapIndexed { idx, chapter ->
|
||||
series.first { it.dir == manga.url }.map { chapter ->
|
||||
SChapter.create().apply {
|
||||
url = chapter.dir
|
||||
name = chapter.toString()
|
||||
chapter_number = idx.toFloat()
|
||||
chapter_number = chapter.number
|
||||
date_upload = 0L
|
||||
}
|
||||
}.reversed()
|
||||
|
|
Loading…
Reference in New Issue