From d4f818b7a8583c1de28aa08035337f3b124d2671 Mon Sep 17 00:00:00 2001 From: Riztard Lanthorn Date: Wed, 11 Nov 2020 00:37:37 +0700 Subject: [PATCH] Emerald fix old chapter (#4837) new chapter doesnt have complete imgUrl in script but old chapter already had complete imgUrl --- src/all/emerald/build.gradle | 2 +- .../tachiyomi/extension/all/emerald/Emerald.kt | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/all/emerald/build.gradle b/src/all/emerald/build.gradle index f5a7fce82..575885d12 100644 --- a/src/all/emerald/build.gradle +++ b/src/all/emerald/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Emerald' pkgNameSuffix = 'all.emerald' extClass = '.EmeraldFactory' - extVersionCode = 4 + extVersionCode = 5 libVersion = '1.2' } diff --git a/src/all/emerald/src/eu/kanade/tachiyomi/extension/all/emerald/Emerald.kt b/src/all/emerald/src/eu/kanade/tachiyomi/extension/all/emerald/Emerald.kt index ab977d087..c64b81cff 100644 --- a/src/all/emerald/src/eu/kanade/tachiyomi/extension/all/emerald/Emerald.kt +++ b/src/all/emerald/src/eu/kanade/tachiyomi/extension/all/emerald/Emerald.kt @@ -290,9 +290,16 @@ open class Emerald( val imgArray = JSONArray(script.substringAfter("const images = ").substringBefore(";")) if (imgArray != null) { - for (i in 0 until imgArray.length()) { - val imgUrl = imgArray.get(i) - pages.add(Page(i, "", "https:${server}$imgUrl")) + if (script.contains("bato.to/images")) { + for (i in 0 until imgArray.length()) { + val imgUrl = imgArray.get(i) + pages.add(Page(i, "", "$imgUrl")) + } + } else { + for (i in 0 until imgArray.length()) { + val imgUrl = imgArray.get(i) + pages.add(Page(i, "", "https:${server}$imgUrl")) + } } } }