From f21cfb81df7f4a62b22eff57384542b2131cea7a Mon Sep 17 00:00:00 2001 From: Suyash Mittal Date: Tue, 25 Oct 2022 02:39:31 +0530 Subject: [PATCH] mangarok fix manga details fetch (#13970) --- src/en/MangaRok/build.gradle | 2 +- .../kanade/tachiyomi/extension/en/mangarok/MangaRok.kt | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/en/MangaRok/build.gradle b/src/en/MangaRok/build.gradle index 5641e2efd..f5d434c9a 100644 --- a/src/en/MangaRok/build.gradle +++ b/src/en/MangaRok/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'MangaRok' pkgNameSuffix = 'en.mangarok' extClass = '.MangaRok' - extVersionCode = 1 + extVersionCode = 2 } apply from: "$rootDir/common.gradle" diff --git a/src/en/MangaRok/src/eu/kanade/tachiyomi/extension/en/mangarok/MangaRok.kt b/src/en/MangaRok/src/eu/kanade/tachiyomi/extension/en/mangarok/MangaRok.kt index c3327a036..a4fd828a9 100644 --- a/src/en/MangaRok/src/eu/kanade/tachiyomi/extension/en/mangarok/MangaRok.kt +++ b/src/en/MangaRok/src/eu/kanade/tachiyomi/extension/en/mangarok/MangaRok.kt @@ -77,21 +77,21 @@ class MangaRok : ParsedHttpSource() { // Details override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply { - title = document.selectFirst("h1").text() + title = document.selectFirst("h1.title").text() thumbnail_url = document.selectFirst("img.athumbnail").attr("abs:data-src") val table = document.selectFirst(".table:not(.is-hoverable)") - artist = table.selectFirst("tr > td:first-child:contains(Artist:) + td > a").text() - author = table.selectFirst("tr > td:first-child:contains(Author:) + td > a").text() + artist = table.selectFirst("tr > td:first-child:contains(Artist:) + td > a")?.text() + author = table.selectFirst("tr > td:first-child:contains(Author:) + td > a")?.text() val altNames = table.select("tr > td:first-child:contains(Alt names:) + td > span") .map { it.text().trimEnd(',') } - description = document.selectFirst("h2 + .content")!!.text() + + description = (document.select("div.content")[1].selectFirst("p")?.text() ?: "") + (altNames.takeIf { it.isNotEmpty() }?.let { "\n\nAlt name(s): ${it.joinToString()}" } ?: "") // Includes "Genre", "Demographic", and "Content" - genre = table.select(".tag.is-info") + genre = table.select("tr > td:first-child:contains(Genre:) + td > span") .joinToString { it.text() } }