MangaThemesia: Allow searching with filter (#13384)

This commit is contained in:
AntsyLich 2022-09-08 17:51:23 +06:00 committed by GitHub
parent 050789f77d
commit d5a44221ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 39 deletions

View File

@ -81,10 +81,10 @@ abstract class MangaThemesia(
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = baseUrl.toHttpUrl().newBuilder()
if (query.isNotEmpty()) {
url.addPathSegments("page/$page").addQueryParameter("s", query)
} else {
url.addPathSegment(mangaUrlDirectory.substring(1)).addQueryParameter("page", page.toString())
.addPathSegment(mangaUrlDirectory.substring(1))
.addQueryParameter("title", query)
.addQueryParameter("page", page.toString())
filters.forEach { filter ->
when (filter) {
is AuthorFilter -> {
@ -119,7 +119,6 @@ abstract class MangaThemesia(
else -> { /* Do Nothing */ }
}
}
}
return GET(url.toString())
}
@ -290,7 +289,7 @@ abstract class MangaThemesia(
}
/**
* Send the view count request to the Madara endpoint.
* Send the view count request to the sites endpoint.
*
* @param document The response document with the wp-manga data
*/
@ -378,7 +377,6 @@ abstract class MangaThemesia(
override fun getFilterList(): FilterList {
val filters = mutableListOf<Filter<*>>(
Filter.Header("NOTE: Ignored if using text search!"),
Filter.Separator(),
AuthorFilter(),
YearFilter(),

View File

@ -10,7 +10,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
override val themeClass = "MangaThemesia"
override val baseVersionCode: Int = 20
override val baseVersionCode: Int = 21
override val sources = listOf(
MultiLang("Asura Scans", "https://www.asurascans.com", listOf("en", "tr"), className = "AsuraScansFactory", pkgName = "asurascans", overrideVersionCode = 16),