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:
henry726 2021-05-24 07:02:58 -04:00 committed by GitHub
parent 6a404595b6
commit f42d8cd443
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Mango'
pkgNameSuffix = 'all.mango'
extClass = '.Mango'
extVersionCode = 2
extVersionCode = 3
libVersion = '1.2'
}

View File

@ -141,9 +141,10 @@ class Mango : ConfigurableSource, HttpSource() {
apiCookies = ""
throw Exception("Login Likely Failed. Try Refreshing.")
}
return result["entries"].asJsonArray.map { obj ->
return result["entries"].asJsonArray.mapIndexed { index, obj ->
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}/"
date_upload = 1000L * obj["mtime"].asLong
}