diff --git a/src/zh/happymh/build.gradle b/src/zh/happymh/build.gradle index 934f3d473..2c229250d 100644 --- a/src/zh/happymh/build.gradle +++ b/src/zh/happymh/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Happymh' pkgNameSuffix = 'zh.happymh' extClass = '.Happymh' - extVersionCode = 1 + extVersionCode = 2 } apply from: "$rootDir/common.gradle" diff --git a/src/zh/happymh/src/eu/kanade/tachiyomi/extension/zh/happymh/Happymh.kt b/src/zh/happymh/src/eu/kanade/tachiyomi/extension/zh/happymh/Happymh.kt index 6ef2c096b..c3a9f63e1 100644 --- a/src/zh/happymh/src/eu/kanade/tachiyomi/extension/zh/happymh/Happymh.kt +++ b/src/zh/happymh/src/eu/kanade/tachiyomi/extension/zh/happymh/Happymh.kt @@ -11,6 +11,7 @@ import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.util.asJsoup import kotlinx.serialization.json.Json import kotlinx.serialization.json.boolean +import kotlinx.serialization.json.int import kotlinx.serialization.json.jsonArray import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonPrimitive @@ -107,10 +108,14 @@ class Happymh : HttpSource() { return GET(baseUrl + chapter.url, header) } - override fun pageListParse(response: Response): List = mutableListOf().apply { - json.parseToJsonElement(response.body!!.string()).jsonObject["data"]!!.jsonObject["scans"]!!.jsonArray.mapIndexed() { index, it -> - add(Page(index, "", it.jsonObject["url"]!!.jsonPrimitive.content)) - } + override fun pageListParse(response: Response): List { + return json.parseToJsonElement(response.body!!.string()) + .jsonObject["data"]!!.jsonObject["scans"]!!.jsonArray + // If n == 1, the image is from next chapter + .filter { it.jsonObject["n"]!!.jsonPrimitive.int == 0 } + .mapIndexed { index, it -> + Page(index, "", it.jsonObject["url"]!!.jsonPrimitive.content) + } } override fun imageUrlParse(response: Response): String = throw Exception("Not Used")