diff --git a/server/src/main/kotlin/ir/armor/tachidesk/util/Search.kt b/server/src/main/kotlin/ir/armor/tachidesk/util/Search.kt index 77b56d0..84f510e 100644 --- a/server/src/main/kotlin/ir/armor/tachidesk/util/Search.kt +++ b/server/src/main/kotlin/ir/armor/tachidesk/util/Search.kt @@ -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 { - 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 - } - } - } -} \ No newline at end of file +//private fun FilterList.toItems(): List { +// 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 +// } +// } +// } +//} \ No newline at end of file