Emerald fix old chapter (#4837)

new chapter doesnt have complete imgUrl in script
but old chapter already had complete imgUrl
This commit is contained in:
Riztard Lanthorn 2020-11-11 00:37:37 +07:00 committed by GitHub
parent 3145072586
commit d4f818b7a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Emerald'
pkgNameSuffix = 'all.emerald'
extClass = '.EmeraldFactory'
extVersionCode = 4
extVersionCode = 5
libVersion = '1.2'
}

View File

@ -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"))
}
}
}
}