From 4803df9e3238f612b3a2d796bd7213f4703de98c Mon Sep 17 00:00:00 2001 From: Vetle Ledaal Date: Fri, 21 Jul 2023 04:07:20 +0200 Subject: [PATCH] Niceoppai: fix duplicate manga (#17192) Update popularManga parser --- src/th/niceoppai/build.gradle | 2 +- .../tachiyomi/extension/th/niceoppai/Niceoppai.kt | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/th/niceoppai/build.gradle b/src/th/niceoppai/build.gradle index 5b58e4467..1c3620517 100644 --- a/src/th/niceoppai/build.gradle +++ b/src/th/niceoppai/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Niceoppai' pkgNameSuffix = 'th.niceoppai' extClass = '.Niceoppai' - extVersionCode = 27 + extVersionCode = 28 isNsfw = true } diff --git a/src/th/niceoppai/src/eu/kanade/tachiyomi/extension/th/niceoppai/Niceoppai.kt b/src/th/niceoppai/src/eu/kanade/tachiyomi/extension/th/niceoppai/Niceoppai.kt index 3e905ef94..f98692c92 100644 --- a/src/th/niceoppai/src/eu/kanade/tachiyomi/extension/th/niceoppai/Niceoppai.kt +++ b/src/th/niceoppai/src/eu/kanade/tachiyomi/extension/th/niceoppai/Niceoppai.kt @@ -43,16 +43,12 @@ class Niceoppai : ParsedHttpSource() { return GET("$baseUrl/manga_list/all/any/most-popular-monthly/$page", headers) } override fun popularMangaSelector() = "div.nde" - override fun popularMangaFromElement(element: Element): SManga { - val manga = SManga.create() - manga.title = element.select("div.det a").text() + override fun popularMangaFromElement(element: Element): SManga = SManga.create().apply { + title = element.selectFirst("div.det a")!!.text() element.select("div.cvr").let { - manga.setUrlWithoutDomain(it.select("div.img_wrp a").attr("href")) - manga.thumbnail_url = it.select("img").attr("abs:src") - manga.initialized = false + setUrlWithoutDomain(it.select("a").attr("href")) + thumbnail_url = it.select("img").attr("abs:src") } - - return manga } override fun popularMangaNextPageSelector() = "ul.pgg li a"