From 29534aa63446fe5cb1d4282dd2e2a7360788a964 Mon Sep 17 00:00:00 2001 From: KirinRaikage Date: Thu, 14 Dec 2023 11:58:07 +0100 Subject: [PATCH] SushiScans sources: Update URL & fix search (#19301) * SushiScanFr: Update URL * Sushi-Scan: Fix search not working * SushiScan: Update searchMangaRequest method * Add missing imports --- .../mangathemesia/sushiscan/src/SushiScan.kt | 12 ++++++++++++ .../mangathemesia/sushiscanfr/src/SushiScanFR.kt | 2 +- .../multisrc/mangathemesia/MangaThemesiaGenerator.kt | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/multisrc/overrides/mangathemesia/sushiscan/src/SushiScan.kt b/multisrc/overrides/mangathemesia/sushiscan/src/SushiScan.kt index 4de98fd4298b..9f5cdf4cc73c 100644 --- a/multisrc/overrides/mangathemesia/sushiscan/src/SushiScan.kt +++ b/multisrc/overrides/mangathemesia/sushiscan/src/SushiScan.kt @@ -1,13 +1,17 @@ package eu.kanade.tachiyomi.extension.fr.sushiscan import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia +import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.interceptor.rateLimit +import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SManga import kotlinx.serialization.Serializable import kotlinx.serialization.decodeFromString import okhttp3.Headers +import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient +import okhttp3.Request import org.jsoup.nodes.Document import java.text.SimpleDateFormat import java.util.Locale @@ -32,6 +36,14 @@ class SushiScan : MangaThemesia("Sushi-Scan", "https://sushiscan.net", "fr", man else -> SManga.UNKNOWN } + override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { + val url = "$baseUrl/page/$page".toHttpUrl().newBuilder() + .addQueryParameter("s", query) + .build() + + return GET(url, headers) + } + override fun mangaDetailsParse(document: Document): SManga = super.mangaDetailsParse(document).apply { status = document.select(seriesStatusSelector).text().parseStatus() diff --git a/multisrc/overrides/mangathemesia/sushiscanfr/src/SushiScanFR.kt b/multisrc/overrides/mangathemesia/sushiscanfr/src/SushiScanFR.kt index c34efc31d9f2..ce6b629818ee 100644 --- a/multisrc/overrides/mangathemesia/sushiscanfr/src/SushiScanFR.kt +++ b/multisrc/overrides/mangathemesia/sushiscanfr/src/SushiScanFR.kt @@ -6,7 +6,7 @@ import org.jsoup.nodes.Document import java.text.SimpleDateFormat import java.util.Locale -class SushiScanFR : MangaThemesia("Sushiscan.fr", "https://sushiscan.fr", "fr", dateFormat = SimpleDateFormat("MMMM d, yyyy", Locale.FRENCH)) { +class SushiScanFR : MangaThemesia("Sushiscan.fr", "https://anime-sama.me", "fr", dateFormat = SimpleDateFormat("MMMM d, yyyy", Locale.FRENCH)) { override val altNamePrefix = "Nom alternatif : " override val seriesAuthorSelector = ".imptdt:contains(Auteur) i, .fmed b:contains(Auteur)+span" override val seriesStatusSelector = ".imptdt:contains(Statut) i" diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt index 96191bae844b..0d879a2a7a6b 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt @@ -140,8 +140,8 @@ class MangaThemesiaGenerator : ThemeSourceGenerator { SingleLang("Summer Fansub", "https://smmr.in", "pt-BR", isNsfw = true), SingleLang("SummerToon", "https://summertoon.com", "tr"), SingleLang("Surya Scans", "https://suryacomics.com", "en", overrideVersionCode = 2), - SingleLang("Sushi-Scan", "https://sushiscan.net", "fr", className = "SushiScan", overrideVersionCode = 9), - SingleLang("Sushiscan.fr", "https://sushiscan.fr", "fr", className = "SushiScanFR"), + SingleLang("Sushi-Scan", "https://sushiscan.net", "fr", className = "SushiScan", overrideVersionCode = 10), + SingleLang("Sushiscan.fr", "https://anime-sama.me", "fr", className = "SushiScanFR", overrideVersionCode = 1), SingleLang("Tarot Scans", "https://www.tarotscans.com", "tr"), SingleLang("Tecno Scan", "https://tecnoscann.com", "es", isNsfw = true, overrideVersionCode = 6), SingleLang("TenkaiScan", "https://tenkaiscan.net", "es", isNsfw = true),