From 723bce9a5a1c64ad1e4315197c0e2257a91d8bfd Mon Sep 17 00:00:00 2001 From: lord-ne <34069872+lord-ne@users.noreply.github.com> Date: Thu, 26 May 2022 06:29:11 -0400 Subject: [PATCH] Also search series from chapter links (#11970) --- src/en/dynasty/build.gradle | 2 +- .../tachiyomi/extension/en/dynasty/DynastySeries.kt | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/en/dynasty/build.gradle b/src/en/dynasty/build.gradle index 3c9c9e3bd..4d64667b0 100644 --- a/src/en/dynasty/build.gradle +++ b/src/en/dynasty/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Dynasty' pkgNameSuffix = 'en.dynasty' extClass = '.DynastyFactory' - extVersionCode = 16 + extVersionCode = 17 } apply from: "$rootDir/common.gradle" diff --git a/src/en/dynasty/src/eu/kanade/tachiyomi/extension/en/dynasty/DynastySeries.kt b/src/en/dynasty/src/eu/kanade/tachiyomi/extension/en/dynasty/DynastySeries.kt index a5661ff3b..4872a6078 100644 --- a/src/en/dynasty/src/eu/kanade/tachiyomi/extension/en/dynasty/DynastySeries.kt +++ b/src/en/dynasty/src/eu/kanade/tachiyomi/extension/en/dynasty/DynastySeries.kt @@ -2,9 +2,11 @@ package eu.kanade.tachiyomi.extension.en.dynasty import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.source.model.FilterList +import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.SManga import okhttp3.Request import org.jsoup.nodes.Document +import rx.Observable class DynastySeries : DynastyScans() { @@ -18,6 +20,16 @@ class DynastySeries : DynastyScans() { return GET("$baseUrl/search?q=$query&classes%5B%5D=Series&sort=&page=$page", headers) } + override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable { + if (query.startsWith("manga:chapters:")) { + val seriesName = Regex("""manga:chapters:(.*?)_ch\d+""").matchEntire(query)?.groups?.get(1)?.value + if (seriesName != null) { + return super.fetchSearchManga(page, "manga:$searchPrefix:$seriesName", filters) + } + } + return super.fetchSearchManga(page, query, filters) + } + override fun mangaDetailsParse(document: Document): SManga { val manga = SManga.create() manga.thumbnail_url = baseUrl + document.select("div.span2 > img").attr("src")