Fix thumbnail not loading (#5186)

This commit is contained in:
antonycaporossi 2020-12-18 23:42:11 +01:00 committed by GitHub
parent 1f964d9f0a
commit 0b1e7fab45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'WNACG' extName = 'WNACG'
pkgNameSuffix = 'zh.wnacg' pkgNameSuffix = 'zh.wnacg'
extClass = '.wnacg' extClass = '.wnacg'
extVersionCode = 3 extVersionCode = 4
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -56,7 +56,7 @@ class wnacg : ParsedHttpSource() {
val manga = SManga.create() val manga = SManga.create()
manga.setUrlWithoutDomain(element.select("a").first().attr("href")) manga.setUrlWithoutDomain(element.select("a").first().attr("href"))
manga.title = element.select("a").attr("title").trim() manga.title = element.select("a").attr("title").trim()
manga.thumbnail_url = "https://" + element.select("img").attr("data-original").replace("//", "") manga.thumbnail_url = "https://" + element.select("img").attr("src").replace("//", "")
// maybe the local cache cause the old source (url) can not be update. but the image can be update on detailpage. // maybe the local cache cause the old source (url) can not be update. but the image can be update on detailpage.
// ps. new machine can be load img normal. // ps. new machine can be load img normal.
@ -83,9 +83,7 @@ class wnacg : ParsedHttpSource() {
manga.title = document.select("h2")?.text()?.trim() ?: "Unknown" manga.title = document.select("h2")?.text()?.trim() ?: "Unknown"
manga.artist = document.select("div.uwuinfo p")?.first()?.text()?.trim() ?: "Unknown" manga.artist = document.select("div.uwuinfo p")?.first()?.text()?.trim() ?: "Unknown"
manga.author = document.select("div.uwuinfo p")?.first()?.text()?.trim() ?: "Unknown" manga.author = document.select("div.uwuinfo p")?.first()?.text()?.trim() ?: "Unknown"
// val glist = document.select("a.tagshow").map { it?.text() } manga.thumbnail_url = "https://" + document.select("div.uwthumb img").first().attr("src").replace("//", "")
// manga.genre = glist.joinToString(", ")
manga.thumbnail_url = "https://" + document.select("div.uwthumb img").first().attr("data-original").replace("//", "")
return manga return manga
} }