fix Mangalife chapter numbers (#6066)
* fix chapter numbers in MangaLife chapter list this commit adds the chapter regex used in MangaSee to MangaLife before - "Chapter 0002" after - "Chapter 2" * update MangaLife build.gradle increments the version number by 1
This commit is contained in:
parent
f7adef8f91
commit
325ccc4ce3
|
@ -5,7 +5,7 @@ ext {
|
||||||
extName = 'MangaLife'
|
extName = 'MangaLife'
|
||||||
pkgNameSuffix = 'en.mangalife'
|
pkgNameSuffix = 'en.mangalife'
|
||||||
extClass = '.MangaLife'
|
extClass = '.MangaLife'
|
||||||
extVersionCode = 10
|
extVersionCode = 11
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -220,8 +220,10 @@ class MangaLife : HttpSource() {
|
||||||
return "-chapter-$n$index$suffix.html"
|
return "-chapter-$n$index$suffix.html"
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun chapterImage(e: String): String {
|
private val chapterImageRegex = Regex("""^0+""")
|
||||||
val a = e.substring(1, e.length - 1)
|
|
||||||
|
private fun chapterImage(e: String, cleanString: Boolean = false): String {
|
||||||
|
val a = e.substring(1, e.length - 1).let { if (cleanString) it.replace(chapterImageRegex, "") else it }
|
||||||
val b = e.substring(e.length - 1).toInt()
|
val b = e.substring(e.length - 1).toInt()
|
||||||
return if (b == 0) {
|
return if (b == 0) {
|
||||||
a
|
a
|
||||||
|
@ -237,7 +239,7 @@ class MangaLife : HttpSource() {
|
||||||
return gson.fromJson<JsonArray>(vmChapters).map { json ->
|
return gson.fromJson<JsonArray>(vmChapters).map { json ->
|
||||||
val indexChapter = json["Chapter"].string
|
val indexChapter = json["Chapter"].string
|
||||||
SChapter.create().apply {
|
SChapter.create().apply {
|
||||||
name = json["ChapterName"].nullString.let { if (it.isNullOrEmpty()) "${json["Type"].string} ${chapterImage(indexChapter)}" else it }
|
name = json["ChapterName"].nullString.let { if (it.isNullOrEmpty()) "${json["Type"].string} ${chapterImage(indexChapter, true)}" else it }
|
||||||
url = "/read-online/" + response.request().url().toString().substringAfter("/manga/") + chapterURLEncode(indexChapter)
|
url = "/read-online/" + response.request().url().toString().substringAfter("/manga/") + chapterURLEncode(indexChapter)
|
||||||
date_upload = try {
|
date_upload = try {
|
||||||
json["Date"].nullString?.let { dateFormat.parse("$it +0600")?.time } ?: 0
|
json["Date"].nullString?.let { dateFormat.parse("$it +0600")?.time } ?: 0
|
||||||
|
|
Loading…
Reference in New Issue