MangaLife - fix chapters (#3112)

This commit is contained in:
Mike 2020-05-11 07:22:30 -04:00 committed by GitHub
parent 8ad5c5e47c
commit 50204b6354
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: MangaLife'
pkgNameSuffix = 'en.mangalife'
extClass = '.MangaLife'
extVersionCode = 4
extVersionCode = 5
libVersion = '1.2'
}

View File

@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.extension.en.mangalife
import com.github.salomonbrys.kotson.fromJson
import com.github.salomonbrys.kotson.get
import com.github.salomonbrys.kotson.nullString
import com.github.salomonbrys.kotson.string
import com.google.gson.GsonBuilder
import com.google.gson.JsonArray
@ -233,7 +234,7 @@ class MangaLife : HttpSource() {
return gson.fromJson<JsonArray>(vmChapters).map { json ->
val indexChapter = json["Chapter"].string
SChapter.create().apply {
name = json["ChapterName"].string.let { if (it.isNotEmpty()) it else "${json["Type"].string} ${chapterImage(indexChapter)}" }
name = json["ChapterName"].nullString.let { if (it.isNullOrEmpty()) "${json["Type"].string} ${chapterImage(indexChapter)}" else it }
url = "/read-online/" + response.request().url().toString().substringAfter("/manga/") + chapterURLEncode(indexChapter)
date_upload = try {
dateFormat.parse(json["Date"].string.substringBefore(" ")).time