mirror of
https://github.com/tachiyomiorg/tachiyomi-extensions-inspector.git
synced 2024-12-25 00:01:49 +01:00
remove unfinished code for now
This commit is contained in:
parent
63783984c6
commit
5313d91bf2
@ -5,7 +5,7 @@ import eu.kanade.tachiyomi.source.model.FilterList
|
||||
|
||||
fun sourceFilters(sourceId: Long) {
|
||||
val source = getHttpSource(sourceId)
|
||||
source.getFilterList().toItems()
|
||||
//source.getFilterList().toItems()
|
||||
}
|
||||
|
||||
fun sourceSearch(sourceId: Long, searchTerm: String) {
|
||||
@ -22,38 +22,38 @@ data class FilterWrapper(
|
||||
val filter: Any
|
||||
)
|
||||
|
||||
private fun FilterList.toItems(): List<FilterWrapper> {
|
||||
return mapNotNull { filter ->
|
||||
when (filter) {
|
||||
is Filter.Header -> FilterWrapper("Header",filter)
|
||||
is Filter.Separator -> FilterWrapper("Separator",filter)
|
||||
is Filter.CheckBox -> FilterWrapper("CheckBox",filter)
|
||||
is Filter.TriState -> FilterWrapper("TriState",filter)
|
||||
is Filter.Text -> FilterWrapper("Text",filter)
|
||||
is Filter.Select<*> -> FilterWrapper("Select",filter)
|
||||
is Filter.Group<*> -> {
|
||||
val group = GroupItem(filter)
|
||||
val subItems = filter.state.mapNotNull {
|
||||
when (it) {
|
||||
is Filter.CheckBox -> FilterWrapper("CheckBox",filter)
|
||||
is Filter.TriState -> FilterWrapper("TriState",filter)
|
||||
is Filter.Text -> FilterWrapper("Text",filter)
|
||||
is Filter.Select<*> -> FilterWrapper("Select",filter)
|
||||
else -> null
|
||||
} as? ISectionable<*, *>
|
||||
}
|
||||
subItems.forEach { it.header = group }
|
||||
group.subItems = subItems
|
||||
group
|
||||
}
|
||||
is Filter.Sort -> {
|
||||
val group = SortGroup(filter)
|
||||
val subItems = filter.values.map {
|
||||
SortItem(it, group)
|
||||
}
|
||||
group.subItems = subItems
|
||||
group
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//private fun FilterList.toItems(): List<FilterWrapper> {
|
||||
// return mapNotNull { filter ->
|
||||
// when (filter) {
|
||||
// is Filter.Header -> FilterWrapper("Header",filter)
|
||||
// is Filter.Separator -> FilterWrapper("Separator",filter)
|
||||
// is Filter.CheckBox -> FilterWrapper("CheckBox",filter)
|
||||
// is Filter.TriState -> FilterWrapper("TriState",filter)
|
||||
// is Filter.Text -> FilterWrapper("Text",filter)
|
||||
// is Filter.Select<*> -> FilterWrapper("Select",filter)
|
||||
// is Filter.Group<*> -> {
|
||||
// val group = GroupItem(filter)
|
||||
// val subItems = filter.state.mapNotNull {
|
||||
// when (it) {
|
||||
// is Filter.CheckBox -> FilterWrapper("CheckBox",filter)
|
||||
// is Filter.TriState -> FilterWrapper("TriState",filter)
|
||||
// is Filter.Text -> FilterWrapper("Text",filter)
|
||||
// is Filter.Select<*> -> FilterWrapper("Select",filter)
|
||||
// else -> null
|
||||
// } as? ISectionable<*, *>
|
||||
// }
|
||||
// subItems.forEach { it.header = group }
|
||||
// group.subItems = subItems
|
||||
// group
|
||||
// }
|
||||
// is Filter.Sort -> {
|
||||
// val group = SortGroup(filter)
|
||||
// val subItems = filter.values.map {
|
||||
// SortItem(it, group)
|
||||
// }
|
||||
// group.subItems = subItems
|
||||
// group
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
Loading…
Reference in New Issue
Block a user