MangaSee - small fix for broken pages (#3663)

This commit is contained in:
Mike 2020-07-01 05:43:53 -04:00 committed by GitHub
parent f14439bcad
commit f4fa994be3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Mangasee'
pkgNameSuffix = 'en.mangasee'
extClass = '.Mangasee'
extVersionCode = 8
extVersionCode = 9
libVersion = '1.2'
}

View File

@ -223,8 +223,8 @@ class Mangasee : HttpSource() {
private val chapterImageRegex = Regex("""^0+""")
private fun chapterImage(e: String): String {
val a = e.substring(1, e.length - 1).replace(chapterImageRegex, "")
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()
return if (b == 0) {
a
@ -240,7 +240,7 @@ class Mangasee : HttpSource() {
return gson.fromJson<JsonArray>(vmChapters).map { json ->
val indexChapter = json["Chapter"].string
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)
date_upload = try {
dateFormat.parse(json["Date"].string.substringBefore(" "))?.time ?: 0