Hanime1.me: Fix tags filter (#339)
This commit is contained in:
parent
1b835f363f
commit
6d89be05aa
2 changed files with 31 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Hanime1'
|
||||
extClass = '.Hanime1'
|
||||
extVersionCode = 1
|
||||
extVersionCode = 2
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -154,7 +154,22 @@ class Hanime1 : AnimeHttpSource(), ConfigurableAnimeSource {
|
|||
if (query.isNotEmpty()) {
|
||||
searchUrl.addQueryParameter("query", query)
|
||||
}
|
||||
filters.list.forEach {
|
||||
filters.list.flatMap {
|
||||
when (it) {
|
||||
is TagsFilter -> {
|
||||
it.state.flatMap { inner ->
|
||||
if (inner is CategoryFilter) {
|
||||
inner.state
|
||||
} else {
|
||||
listOf(inner)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
is AnimeFilter.Group<*> -> it.state
|
||||
else -> listOf(it)
|
||||
}
|
||||
}.forEach {
|
||||
when (it) {
|
||||
is QueryFilter -> {
|
||||
if (it.selected.isNotEmpty()) {
|
||||
|
@ -162,7 +177,18 @@ class Hanime1 : AnimeHttpSource(), ConfigurableAnimeSource {
|
|||
}
|
||||
}
|
||||
|
||||
is TagFilter -> searchUrl.addQueryParameter(it.key, it.name)
|
||||
is BroadMatchFilter -> {
|
||||
if (it.state) {
|
||||
searchUrl.addQueryParameter(it.key, "on")
|
||||
}
|
||||
}
|
||||
|
||||
is TagFilter -> {
|
||||
if (it.state) {
|
||||
searchUrl.addQueryParameter(it.key, it.name)
|
||||
}
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
@ -258,7 +284,8 @@ class Hanime1 : AnimeHttpSource(), ConfigurableAnimeSource {
|
|||
entries = arrayOf("1080P", "720P", "480P")
|
||||
entryValues = entries
|
||||
setDefaultValue(DEFAULT_QUALITY)
|
||||
summary = "當前選擇:${preferences.getString(PREF_KEY_VIDEO_QUALITY, DEFAULT_QUALITY)}"
|
||||
summary =
|
||||
"當前選擇:${preferences.getString(PREF_KEY_VIDEO_QUALITY, DEFAULT_QUALITY)}"
|
||||
setOnPreferenceChangeListener { _, newValue ->
|
||||
summary = "當前選擇:${newValue as String}"
|
||||
true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue