mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-22 18:32:39 +01:00
NHentai | Fixed "Pages" & "Uploaded" Filters (#4678)
Fixed "Pages" & "Uploaded" Filters - Also removed "isOkayToSort" because I think it's useless... ( might be wrong? )
This commit is contained in:
parent
ce452d0bbe
commit
df2ce43cec
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'NHentai'
|
||||
extClass = '.NHFactory'
|
||||
extVersionCode = 45
|
||||
extVersionCode = 46
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,6 @@ open class NHentai(
|
||||
val nhLangSearch = if (nhLang.isBlank()) "" else "language:$nhLang "
|
||||
val advQuery = combineQuery(filterList)
|
||||
val favoriteFilter = filterList.findInstance<FavoriteFilter>()
|
||||
val isOkayToSort = filterList.findInstance<UploadedFilter>()?.state?.isBlank() ?: true
|
||||
val offsetPage =
|
||||
filterList.findInstance<OffsetPageFilter>()?.state?.toIntOrNull()?.plus(page) ?: page
|
||||
|
||||
@ -157,10 +156,8 @@ open class NHentai(
|
||||
.addQueryParameter("q", "$query $nhLangSearch$advQuery".ifBlank { "\"\"" })
|
||||
.addQueryParameter("page", offsetPage.toString())
|
||||
|
||||
if (isOkayToSort) {
|
||||
filterList.findInstance<SortFilter>()?.let { f ->
|
||||
url.addQueryParameter("sort", f.toUriPart())
|
||||
}
|
||||
filterList.findInstance<SortFilter>()?.let { f ->
|
||||
url.addQueryParameter("sort", f.toUriPart())
|
||||
}
|
||||
|
||||
return GET(url.build(), headers)
|
||||
@ -173,8 +170,13 @@ open class NHentai(
|
||||
.map(String::trim)
|
||||
.filterNot(String::isBlank)
|
||||
.forEach { tag ->
|
||||
val y = !(filter.name == "Pages" || filter.name == "Uploaded")
|
||||
if (tag.startsWith("-")) append("-")
|
||||
append(filter.name, ":\"", tag.removePrefix("-"), "\" ")
|
||||
append(filter.name, ':')
|
||||
if (y) append('"')
|
||||
append(tag.removePrefix("-"))
|
||||
if (y) append('"')
|
||||
append(" ")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user