Fix MangaJar page list parsing (#7400)

* fix[mangajar]: fix page list parsing

* style[mangajar]: remove braces from if-expression, use hasAttr

* fix[mangajar]: fix if-else
This commit is contained in:
E-Hern Lee 2021-06-04 21:40:15 +10:00 committed by GitHub
parent cf9ed00c61
commit 1ecd11ced4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'MangaJar' extName = 'MangaJar'
pkgNameSuffix = 'en.mangajar' pkgNameSuffix = 'en.mangajar'
extClass = '.MangaJar' extClass = '.MangaJar'
extVersionCode = 3 extVersionCode = 4
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -143,7 +143,7 @@ class MangaJar : ParsedHttpSource() {
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
return document.select("img[data-page]").mapIndexed { i, element -> return document.select("img[data-page]").mapIndexed { i, element ->
Page(i, "", element.attr("data-alternative")) Page(i, "", if (element.hasAttr("data-src")) element.attr("abs:data-src") else element.attr("abs:src"))
} }
} }