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
042abd4e93
commit
1302bf5e80
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'NHentai'
|
extName = 'NHentai'
|
||||||
extClass = '.NHFactory'
|
extClass = '.NHFactory'
|
||||||
extVersionCode = 45
|
extVersionCode = 46
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,6 @@ open class NHentai(
|
||||||
val nhLangSearch = if (nhLang.isBlank()) "" else "language:$nhLang "
|
val nhLangSearch = if (nhLang.isBlank()) "" else "language:$nhLang "
|
||||||
val advQuery = combineQuery(filterList)
|
val advQuery = combineQuery(filterList)
|
||||||
val favoriteFilter = filterList.findInstance<FavoriteFilter>()
|
val favoriteFilter = filterList.findInstance<FavoriteFilter>()
|
||||||
val isOkayToSort = filterList.findInstance<UploadedFilter>()?.state?.isBlank() ?: true
|
|
||||||
val offsetPage =
|
val offsetPage =
|
||||||
filterList.findInstance<OffsetPageFilter>()?.state?.toIntOrNull()?.plus(page) ?: page
|
filterList.findInstance<OffsetPageFilter>()?.state?.toIntOrNull()?.plus(page) ?: page
|
||||||
|
|
||||||
|
@ -157,10 +156,8 @@ open class NHentai(
|
||||||
.addQueryParameter("q", "$query $nhLangSearch$advQuery".ifBlank { "\"\"" })
|
.addQueryParameter("q", "$query $nhLangSearch$advQuery".ifBlank { "\"\"" })
|
||||||
.addQueryParameter("page", offsetPage.toString())
|
.addQueryParameter("page", offsetPage.toString())
|
||||||
|
|
||||||
if (isOkayToSort) {
|
filterList.findInstance<SortFilter>()?.let { f ->
|
||||||
filterList.findInstance<SortFilter>()?.let { f ->
|
url.addQueryParameter("sort", f.toUriPart())
|
||||||
url.addQueryParameter("sort", f.toUriPart())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GET(url.build(), headers)
|
return GET(url.build(), headers)
|
||||||
|
@ -173,8 +170,13 @@ open class NHentai(
|
||||||
.map(String::trim)
|
.map(String::trim)
|
||||||
.filterNot(String::isBlank)
|
.filterNot(String::isBlank)
|
||||||
.forEach { tag ->
|
.forEach { tag ->
|
||||||
|
val y = !(filter.name == "Pages" || filter.name == "Uploaded")
|
||||||
if (tag.startsWith("-")) append("-")
|
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