From 4a1a040b23283699e3984ee03102a14bf0e28d8e Mon Sep 17 00:00:00 2001 From: Romain Date: Sun, 5 Jan 2025 01:36:52 +0100 Subject: [PATCH] Patch ReaperScans (#6982) * Patch ReaperScans * Resolve some mistakes Co-authored-by: Vetle Ledaal --------- Co-authored-by: Vetle Ledaal --- .../kanade/tachiyomi/multisrc/keyoapp/Keyoapp.kt | 2 +- .../extension/fr/reaperscans/ReaperScans.kt | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib-multisrc/keyoapp/src/eu/kanade/tachiyomi/multisrc/keyoapp/Keyoapp.kt b/lib-multisrc/keyoapp/src/eu/kanade/tachiyomi/multisrc/keyoapp/Keyoapp.kt index 587bb99bb..cd59f6817 100644 --- a/lib-multisrc/keyoapp/src/eu/kanade/tachiyomi/multisrc/keyoapp/Keyoapp.kt +++ b/lib-multisrc/keyoapp/src/eu/kanade/tachiyomi/multisrc/keyoapp/Keyoapp.kt @@ -228,7 +228,7 @@ abstract class Keyoapp( }.joinToString() } - private fun Element?.parseStatus(): Int = when (this?.text()?.lowercase()) { + protected fun Element?.parseStatus(): Int = when (this?.text()?.lowercase()) { "ongoing" -> SManga.ONGOING "dropped" -> SManga.CANCELLED "paused" -> SManga.ON_HIATUS diff --git a/src/fr/reaperscans/src/eu/kanade/tachiyomi/extension/fr/reaperscans/ReaperScans.kt b/src/fr/reaperscans/src/eu/kanade/tachiyomi/extension/fr/reaperscans/ReaperScans.kt index 516a7f232..29d5e8ee7 100644 --- a/src/fr/reaperscans/src/eu/kanade/tachiyomi/extension/fr/reaperscans/ReaperScans.kt +++ b/src/fr/reaperscans/src/eu/kanade/tachiyomi/extension/fr/reaperscans/ReaperScans.kt @@ -1,6 +1,8 @@ package eu.kanade.tachiyomi.extension.fr.reaperscans import eu.kanade.tachiyomi.multisrc.keyoapp.Keyoapp +import eu.kanade.tachiyomi.source.model.SManga +import org.jsoup.nodes.Document class ReaperScans : Keyoapp( "Reaper Scans", @@ -8,6 +10,18 @@ class ReaperScans : Keyoapp( "fr", ) { + override fun mangaDetailsParse(document: Document): SManga = + super.mangaDetailsParse(document).apply { + if (description.isNullOrBlank() == true) { + description = document.selectFirst("#expand_content > p")?.text() + } + + // Search for the sibling div of the image with the status icon + status = document.selectFirst("div:has(> img[src*=status]) + div").parseStatus() + + genre = document.select("div:has(>h1) > div > a").joinToString { it.text() } + } + // Migrated from Madara to Keyoapp. override val versionId = 4 }