From 5f9eb38b77aed2c382292ffa8c744d9c4448f289 Mon Sep 17 00:00:00 2001 From: Vetle Ledaal Date: Sun, 3 Jul 2022 16:14:25 +0000 Subject: [PATCH] Mangasail: allow optional fields when parsing manga details (#12420) --- src/en/mangasail/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/en/mangasail/Mangasail.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/en/mangasail/build.gradle b/src/en/mangasail/build.gradle index 38a70b22b..7e2742b38 100644 --- a/src/en/mangasail/build.gradle +++ b/src/en/mangasail/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Mangasail' pkgNameSuffix = 'en.mangasail' extClass = '.Mangasail' - extVersionCode = 3 + extVersionCode = 4 } apply from: "$rootDir/common.gradle" diff --git a/src/en/mangasail/src/eu/kanade/tachiyomi/extension/en/mangasail/Mangasail.kt b/src/en/mangasail/src/eu/kanade/tachiyomi/extension/en/mangasail/Mangasail.kt index 2ca7ffdc7..d31d2359f 100644 --- a/src/en/mangasail/src/eu/kanade/tachiyomi/extension/en/mangasail/Mangasail.kt +++ b/src/en/mangasail/src/eu/kanade/tachiyomi/extension/en/mangasail/Mangasail.kt @@ -115,9 +115,9 @@ class Mangasail : ParsedHttpSource() { return parse(htmlString).let { when (field) { "field_image2" -> it.selectFirst("img.img-responsive").attr("src") - "field_status", "field_author", "field_artist" -> it.selectFirst("div.field-item.even").text() - "body" -> it.selectFirst("div.field-item.even p").text().substringAfter("summary: ") - "field_genres" -> it.select("a").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: ") + "field_genres" -> it.select("a")?.text() else -> null } }