WeebCentral: Exclude special characters (#7164)
exclude special characters for search
This commit is contained in:
parent
c9af13410f
commit
03accf8717
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Weeb Central'
|
||||
extClass = '.WeebCentral'
|
||||
extVersionCode = 7
|
||||
extVersionCode = 8
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,8 @@ class WeebCentral : ParsedHttpSource() {
|
||||
|
||||
private val dateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ENGLISH)
|
||||
|
||||
private val excludedSearchCharacters = "[!#:()]".toRegex()
|
||||
|
||||
// ============================== Popular ===============================
|
||||
|
||||
override fun popularMangaRequest(page: Int): Request = searchMangaRequest(
|
||||
@ -64,11 +66,10 @@ class WeebCentral : ParsedHttpSource() {
|
||||
override fun latestUpdatesNextPageSelector(): String = searchMangaNextPageSelector()
|
||||
|
||||
// =============================== Search ===============================
|
||||
|
||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||
val filterList = filters.ifEmpty { getFilterList() }
|
||||
val url = "$baseUrl/search/data".toHttpUrl().newBuilder().apply {
|
||||
addQueryParameter("text", query)
|
||||
addQueryParameter("text", query.replace(excludedSearchCharacters, " ").trim())
|
||||
filterList.filterIsInstance<UriFilter>().forEach {
|
||||
it.addToUri(this)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user