Mango: Add chapter numbers (#7193)
* Update Mango.kt Added chapter numbers based on index order (same way they appear on the web client) * Update build.gradle * Update Mango.kt Adds chapter number to the beginning of the chapter name
This commit is contained in:
parent
6a404595b6
commit
f42d8cd443
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'Mango'
|
extName = 'Mango'
|
||||||
pkgNameSuffix = 'all.mango'
|
pkgNameSuffix = 'all.mango'
|
||||||
extClass = '.Mango'
|
extClass = '.Mango'
|
||||||
extVersionCode = 2
|
extVersionCode = 3
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,9 +141,10 @@ class Mango : ConfigurableSource, HttpSource() {
|
|||||||
apiCookies = ""
|
apiCookies = ""
|
||||||
throw Exception("Login Likely Failed. Try Refreshing.")
|
throw Exception("Login Likely Failed. Try Refreshing.")
|
||||||
}
|
}
|
||||||
return result["entries"].asJsonArray.map { obj ->
|
return result["entries"].asJsonArray.mapIndexed { index, obj ->
|
||||||
SChapter.create().apply {
|
SChapter.create().apply {
|
||||||
name = obj["display_name"].asString
|
chapter_number = index + 1F
|
||||||
|
name = "${chapter_number.toInt()} - ${obj["display_name"].asString}"
|
||||||
url = "/page/${obj["title_id"].asString}/${obj["id"].asString}/${obj["pages"].asString}/"
|
url = "/page/${obj["title_id"].asString}/${obj["id"].asString}/${obj["pages"].asString}/"
|
||||||
date_upload = 1000L * obj["mtime"].asLong
|
date_upload = 1000L * obj["mtime"].asLong
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user