From 50204b635474d8a26e48527fa77c132bce60761a Mon Sep 17 00:00:00 2001 From: Mike <51273546+SnakeDoc83@users.noreply.github.com> Date: Mon, 11 May 2020 07:22:30 -0400 Subject: [PATCH] MangaLife - fix chapters (#3112) --- src/en/mangalife/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/en/mangalife/MangaLife.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/en/mangalife/build.gradle b/src/en/mangalife/build.gradle index f55df1eb4..9378b17b6 100644 --- a/src/en/mangalife/build.gradle +++ b/src/en/mangalife/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: MangaLife' pkgNameSuffix = 'en.mangalife' extClass = '.MangaLife' - extVersionCode = 4 + extVersionCode = 5 libVersion = '1.2' } diff --git a/src/en/mangalife/src/eu/kanade/tachiyomi/extension/en/mangalife/MangaLife.kt b/src/en/mangalife/src/eu/kanade/tachiyomi/extension/en/mangalife/MangaLife.kt index 41e6df294..04b0a36bf 100644 --- a/src/en/mangalife/src/eu/kanade/tachiyomi/extension/en/mangalife/MangaLife.kt +++ b/src/en/mangalife/src/eu/kanade/tachiyomi/extension/en/mangalife/MangaLife.kt @@ -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(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