fix(id/mikoroku): Fix page list + Enable ZeistManga's search filters (#19421)

* fix: Fix page list on new entries

* feat: Set artist & author in mangaDetails page

* feat: Enable Genres & Status filter

* chore: Bump version

* fix: Add missing genres to filter

* fix: Merge suggestion - Add historical genre

Thanks TheKingTermux!

Co-authored-by: TheKingTermux <50316075+TheKingTermux@users.noreply.github.com>

---------

Co-authored-by: TheKingTermux <50316075+TheKingTermux@users.noreply.github.com>
This commit is contained in:
Claudemirovsky 2023-12-26 08:28:30 -03:00 committed by GitHub
parent db07d894e9
commit e89862aa1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 70 additions and 10 deletions

View File

@ -1,26 +1,86 @@
package eu.kanade.tachiyomi.extension.id.mikoroku
import eu.kanade.tachiyomi.multisrc.zeistmanga.Genre
import eu.kanade.tachiyomi.multisrc.zeistmanga.Status
import eu.kanade.tachiyomi.multisrc.zeistmanga.ZeistManga
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Response
import org.jsoup.nodes.Element
class MikoRoku : ZeistManga("MikoRoku", "https://www.mikoroku.web.id", "id") {
// ============================== Popular ===============================
override val popularMangaSelector = "div.PopularPosts article"
override val popularMangaSelectorTitle = ".post-title a"
override val popularMangaSelectorUrl = ".post-title a"
override val pageListSelector = "article#reader div.separator a"
// ============================== Filters ===============================
override val hasFilters = true
override fun mangaDetailsParse(response: Response): SManga = SManga.create().apply {
val document = response.asJsoup()
with(document.selectFirst("div.section#main div.widget header")!!) {
thumbnail_url = selectFirst("img")!!.attr("abs:src")
genre = select("aside dl:has(dt:contains(Genre)) dd a")
.joinToString { it.text() }
status = parseStatus(selectFirst("span[data-status]")!!.text())
// The source actually has both, but they return no result, so its useless.
override val hasLanguageFilter = false
override val hasTypeFilter = false
override fun getStatusList() = listOf(
Status("Semua", ""),
Status("Ongoing", "Ongoing"),
Status("Completed", "Completed"),
)
override fun getGenreList() = listOf(
Genre("Action", "Action"),
Genre("Adventure", "Adventure"),
Genre("Comedy", "Comedy"),
Genre("Dark Fantasy", "Dark Fantasy"),
Genre("Drama", "Drama"),
Genre("Fantasy", "Fantasy"),
Genre("Harem", "H4rem"),
Genre("Historical", "Historical"),
Genre("Horror", "Horror"),
Genre("Isekai", "Isekai"),
Genre("Magic", "Magic"),
Genre("Mecha", "Mecha"),
Genre("Military", "Military"),
Genre("Monsters", "Monsters"),
Genre("Mystery", "Mystery"),
Genre("Psychological", "Psychological"),
Genre("Romance", "Romance"),
Genre("School Life", "School Life"),
Genre("Sci-Fi", "Sci-Fi"),
Genre("Seinen", "Seinen"),
Genre("Shounen", "Shounen"),
Genre("Slice of Life", "Slice of Life"),
Genre("Supernatural", "Supernatural"),
Genre("Survival", "Survival"),
Genre("Tragedy", "Tragedy"),
)
// =========================== Manga Details ============================
override val mangaDetailsSelector = "div.section#main div.widget:has(main)"
override val mangaDetailsSelectorGenres = "dl > dd > a[rel=tag]"
override fun mangaDetailsParse(response: Response): SManga {
val document = response.use { it.asJsoup() }
val profileManga = document.selectFirst(mangaDetailsSelector)!!
return SManga.create().apply {
with(profileManga) {
thumbnail_url = selectFirst("img")?.absUrl("src")
description = document.select(mangaDetailsSelectorDescription).text()
genre = select(mangaDetailsSelectorGenres).eachText().joinToString()
status = parseStatus(selectFirst("span[data-status]")?.text().orEmpty())
author = getInfo("Author")
artist = getInfo("Artist")
}
}
description = document.select("div.section#main div.widget div.grid #synopsis").text()
}
private fun Element.getInfo(text: String): String? =
selectFirst("$mangaDetailsSelectorInfo:containsOwn($text) > $mangaDetailsSelectorInfoDescription")
?.text()
?.trim()
// =============================== Pages ================================
// Specific/faster selection first, generic/slower last
override val pageListSelector = "article#reader div.separator a, article#reader"
}

View File

@ -22,7 +22,7 @@ class ZeistMangaGenerator : ThemeSourceGenerator {
SingleLang("Loner Translations", "https://loner-tl.blogspot.com", "ar"),
SingleLang("Manga Ai Land", "https://manga-ai-land.blogspot.com", "ar"),
SingleLang("Manga Soul", "https://www.manga-soul.com", "ar", isNsfw = true),
SingleLang("MikoRoku", "https://www.mikoroku.web.id", "id", isNsfw = true),
SingleLang("MikoRoku", "https://www.mikoroku.web.id", "id", isNsfw = true, overrideVersionCode = 1),
SingleLang("Mikrokosmos Fansub", "https://mikrokosmosfb.blogspot.com", "tr", isNsfw = true),
SingleLang("ShiyuraSub", "https://shiyurasub.blogspot.com", "id"),
SingleLang("SobatManKu", "https://www.sobatmanku19.site", "id"),