Mangasail: allow optional fields when parsing manga details (#12420)
This commit is contained in:
parent
4164917567
commit
5f9eb38b77
|
@ -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"
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue