MGKomik: fix null pointer error (#10215)

This commit is contained in:
Luqman 2025-08-22 02:21:26 +07:00 committed by Draff
parent d62b06989b
commit 77b89cec80
Signed by: Draff
GPG Key ID: E8A89F3211677653
2 changed files with 6 additions and 14 deletions

View File

@ -3,7 +3,7 @@ ext {
extClass = '.MGKomik' extClass = '.MGKomik'
themePkg = 'madara' themePkg = 'madara'
baseUrl = 'https://id.mgkomik.cc' baseUrl = 'https://id.mgkomik.cc'
overrideVersionCode = 17 overrideVersionCode = 18
isNsfw = false isNsfw = false
} }

View File

@ -45,22 +45,14 @@ class MGKomik : Madara(
// ================================== Popular ====================================== // ================================== Popular ======================================
// overriding to change title selector and manga url selector
override fun popularMangaFromElement(element: Element): SManga { override fun popularMangaFromElement(element: Element): SManga {
val manga = SManga.create() return SManga.create().apply {
element.select("div.item-thumb a").let {
with(element) { setUrlWithoutDomain(it.attr("abs:href"))
selectFirst("div.item-thumb a")!!.let { title = it.attr("title")
manga.setUrlWithoutDomain(it.attr("abs:href")) thumbnail_url = it.select("img").attr("abs:src")
manga.title = it.attr("title")
}
selectFirst("img")?.let {
manga.thumbnail_url = imageFromElement(it)
} }
} }
return manga
} }
// ================================ Chapters ================================ // ================================ Chapters ================================