MangAdventure: support custom chapter titles (#2282)
This commit is contained in:
parent
53d6cbf97d
commit
b1f787e5b2
|
@ -5,7 +5,7 @@ ext {
|
|||
appName = 'Tachiyomi: MangAdventure'
|
||||
pkgNameSuffix = 'all.mangadventure'
|
||||
extClass = '.MangAdventureFactory'
|
||||
extVersionCode = 5
|
||||
extVersionCode = 6
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ abstract class MangAdventure(
|
|||
}
|
||||
)
|
||||
}
|
||||
}.sortedByDescending(SChapter::name).toList()
|
||||
}.toList().reversed()
|
||||
}
|
||||
|
||||
override fun mangaDetailsParse(response: Response) =
|
||||
|
@ -131,7 +131,9 @@ abstract class MangAdventure(
|
|||
override fun pageListParse(response: Response) =
|
||||
JSONObject(response.asString()).run {
|
||||
val url = getString("url")
|
||||
// Workaround for a bug in MangAdventure < 0.6.3
|
||||
val root = getString("pages_root")
|
||||
.replace("://media/series", "://reader")
|
||||
val arr = getJSONArray("pages_list")
|
||||
(0 until arr.length()).map {
|
||||
Page(it, "$url${it + 1}", "$root${arr.getString(it)}")
|
||||
|
|
|
@ -72,10 +72,10 @@ fun SChapter.fromJSON(obj: JSONObject) = apply {
|
|||
chapter_number = obj.optString("chapter", "0").toFloat()
|
||||
date_upload = MangAdventure.httpDateToTimestamp(obj.getString("date"))
|
||||
scanlator = obj.getJSONArray("groups")?.joinField("name", " & ")
|
||||
name = buildString {
|
||||
obj.optInt("volume").let { if (it != 0) append("Vol.$it ") }
|
||||
append("Ch.${DecimalFormat("#.#").format(chapter_number)} - ")
|
||||
name = obj.optString("full_title", buildString {
|
||||
obj.optInt("volume").let { if (it != 0) append("Vol. $it, ") }
|
||||
append("Ch. ${DecimalFormat("#.#").format(chapter_number)}: ")
|
||||
append(obj.getString("title"))
|
||||
if (obj.getBoolean("final")) append(" [END]")
|
||||
}
|
||||
})
|
||||
if (obj.getBoolean("final")) name += " [END]"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue