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