Mangasail: allow optional fields when parsing manga details (#12420)

This commit is contained in:
Vetle Ledaal 2022-07-03 16:14:25 +00:00 committed by GitHub
parent 4164917567
commit 5f9eb38b77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Mangasail' extName = 'Mangasail'
pkgNameSuffix = 'en.mangasail' pkgNameSuffix = 'en.mangasail'
extClass = '.Mangasail' extClass = '.Mangasail'
extVersionCode = 3 extVersionCode = 4
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -115,9 +115,9 @@ class Mangasail : ParsedHttpSource() {
return parse(htmlString).let { return parse(htmlString).let {
when (field) { when (field) {
"field_image2" -> it.selectFirst("img.img-responsive").attr("src") "field_image2" -> it.selectFirst("img.img-responsive").attr("src")
"field_status", "field_author", "field_artist" -> it.selectFirst("div.field-item.even").text() "field_status", "field_author", "field_artist" -> it.selectFirst("div.field-item.even")?.text()
"body" -> it.selectFirst("div.field-item.even p").text().substringAfter("summary: ") "body" -> it.selectFirst("div.field-item.even p")?.text()?.substringAfter("summary: ")
"field_genres" -> it.select("a").text() "field_genres" -> it.select("a")?.text()
else -> null else -> null
} }
} }