Also search series from chapter links (#11970)

This commit is contained in:
lord-ne 2022-05-26 06:29:11 -04:00 committed by GitHub
parent 26be465c84
commit 723bce9a5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Dynasty'
pkgNameSuffix = 'en.dynasty'
extClass = '.DynastyFactory'
extVersionCode = 16
extVersionCode = 17
}
apply from: "$rootDir/common.gradle"

View File

@ -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<MangasPage> {
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")