[mgo] fix filtering by genre (#15087)

* [mgo] fix filtering by genre

* bump
This commit is contained in:
beerpsi 2023-01-24 19:53:14 +07:00 committed by GitHub
parent 2e7414a197
commit 1fccdf3d28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Mangago'
pkgNameSuffix = 'en.mangago'
extClass = '.Mangago'
extVersionCode = 11
extVersionCode = 12
isNsfw = true
}

View File

@ -245,8 +245,8 @@ class Mangago : ParsedHttpSource() {
override fun getFilterList(): FilterList = FilterList(
Filter.Header("Ignored if using text search"),
StatusFilterGroup(),
SortFilter(),
StatusFilterGroup(),
GenreFilterGroup(),
)
@ -254,7 +254,7 @@ class Mangago : ParsedHttpSource() {
fun addToUrl(builder: HttpUrl.Builder)
}
private class StatusFilter(name: String, val query: String) : UriFilter, Filter.CheckBox(name) {
private class StatusFilter(name: String, val query: String, state: Boolean) : UriFilter, Filter.CheckBox(name, state) {
override fun addToUrl(builder: HttpUrl.Builder) {
builder.addQueryParameter(query, if (state) "1" else "0")
}
@ -263,8 +263,8 @@ class Mangago : ParsedHttpSource() {
private class StatusFilterGroup : UriFilter, Filter.Group<StatusFilter>(
"Status",
listOf(
StatusFilter("Completed", "f"),
StatusFilter("Ongoing", "o")
StatusFilter("Completed", "f", true),
StatusFilter("Ongoing", "o", true)
)
) {
override fun addToUrl(builder: HttpUrl.Builder) {