From d6a6a0d74f4e101c2c98b9790c84506681cbec2a Mon Sep 17 00:00:00 2001 From: Vetle Ledaal Date: Fri, 20 Jan 2023 15:58:02 +0100 Subject: [PATCH] [mgo] fix chapter selector, fix mobile search (#15040) * mgo: fix chapter list selector * fix search on mobile ua * bump version * make mgo work properly with either desktop or mobile ua --- src/en/mangago/build.gradle | 2 +- .../tachiyomi/extension/en/mangago/Mangago.kt | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/en/mangago/build.gradle b/src/en/mangago/build.gradle index 6e9fd4687..3239854ef 100644 --- a/src/en/mangago/build.gradle +++ b/src/en/mangago/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Mangago' pkgNameSuffix = 'en.mangago' extClass = '.Mangago' - extVersionCode = 10 + extVersionCode = 11 isNsfw = true } diff --git a/src/en/mangago/src/eu/kanade/tachiyomi/extension/en/mangago/Mangago.kt b/src/en/mangago/src/eu/kanade/tachiyomi/extension/en/mangago/Mangago.kt index 0f346dea2..0b786815f 100644 --- a/src/en/mangago/src/eu/kanade/tachiyomi/extension/en/mangago/Mangago.kt +++ b/src/en/mangago/src/eu/kanade/tachiyomi/extension/en/mangago/Mangago.kt @@ -143,33 +143,33 @@ class Mangago : ParsedHttpSource() { return GET(url, headers) } - override fun searchMangaSelector() = "$genreListingSelector, .pic_list .box" + override fun searchMangaSelector() = "$genreListingSelector, .pic_list > li" override fun searchMangaFromElement(element: Element) = mangaFromElement(element) override fun searchMangaNextPageSelector() = genreListingNextPageSelector override fun mangaDetailsParse(document: Document) = SManga.create().apply { + title = document.selectFirst(".w-title h1").text() document.getElementById("information").let { - title = it.selectFirst(".w-title h1").text() thumbnail_url = it.selectFirst("img").attr("abs:src") description = it.selectFirst(".manga_summary").text() - it.select(".manga_info li").forEach { el -> - when (el.selectFirst("b").text().trim().lowercase()) { + it.select(".manga_info li, .manga_right tr").forEach { el -> + when (el.selectFirst("b, label").text().lowercase()) { "alternative:" -> description += "\n\n${el.text()}" - "status:" -> when (el.selectFirst("span").text().trim().lowercase()) { + "status:" -> status = when (el.selectFirst("span").text().lowercase()) { "ongoing" -> SManga.ONGOING "completed" -> SManga.COMPLETED else -> SManga.UNKNOWN } - "author(s):" -> author = el.select("a").joinToString { it.text() } + "author(s):", "author:" -> author = el.select("a").joinToString { it.text() } "genre(s):" -> genre = el.select("a").joinToString { it.text() } } } } } - override fun chapterListSelector() = "table > tbody > tr" + override fun chapterListSelector() = "table#chapter_table > tbody > tr, table.uk-table > tbody > tr" override fun chapterFromElement(element: Element) = SChapter.create().apply { val link = element.getElementsByTag("a")