Keyoapp: Fix duplicate entries (#8226)

* Fix duplicate entries

* Remove delimiter

Co-authored-by: Vetle Ledaal <vetle.ledaal@gmail.com>

---------

Co-authored-by: Vetle Ledaal <vetle.ledaal@gmail.com>
This commit is contained in:
Chopper 2025-03-27 17:08:03 -03:00 committed by Draff
parent 8ee6d0184e
commit ae982b97ca
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 15 additions and 3 deletions

View File

@ -2,7 +2,7 @@ plugins {
id("lib-multisrc")
}
baseVersionCode = 15
baseVersionCode = 16
dependencies {
api(project(":lib:i18n"))

View File

@ -59,8 +59,16 @@ abstract class Keyoapp(
override fun popularMangaRequest(page: Int): Request = GET(baseUrl, headers)
override fun popularMangaSelector(): String =
"div.flex-col div.grid > div.group.border, div:has(h2:contains(Trending)) + div .group.overflow-hidden.grid"
open val popularMangaTitleSelector = listOf(
"Popular",
"Popularie",
"Trending",
)
override fun popularMangaSelector(): String = selector(
"div:contains(%s) + div .group.overflow-hidden.grid",
popularMangaTitleSelector,
)
override fun popularMangaFromElement(element: Element): SManga = SManga.create().apply {
thumbnail_url = element.getImageUrl("*[style*=background-image]")
@ -357,6 +365,10 @@ abstract class Keyoapp(
return now.timeInMillis
}
private fun selector(selector: String, contains: List<String>): String {
return contains.joinToString { selector.replace("%s", it) }
}
override fun setupPreferenceScreen(screen: PreferenceScreen) {
SwitchPreferenceCompat(screen.context).apply {
key = SHOW_PAID_CHAPTERS_PREF