mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fix searching collapsed categories when using single category mode
This commit is contained in:
parent
2879db53eb
commit
9e0ebb2ddc
1 changed files with 7 additions and 7 deletions
|
@ -583,18 +583,18 @@ class LibraryPresenter(
|
||||||
LibraryItem(it, headerItem)
|
LibraryItem(it, headerItem)
|
||||||
}.toMutableList()
|
}.toMutableList()
|
||||||
|
|
||||||
val categoriesHidden = preferences.collapsedCategories().get().mapNotNull {
|
val categoriesHidden = if (forceShowAllCategories) {
|
||||||
it.toIntOrNull()
|
emptySet()
|
||||||
}.toMutableSet()
|
} else {
|
||||||
|
preferences.collapsedCategories().get().mapNotNull { it.toIntOrNull() }.toSet()
|
||||||
|
}
|
||||||
|
|
||||||
if (categorySet.contains(0)) categories.add(0, createDefaultCategory())
|
if (categorySet.contains(0)) categories.add(0, createDefaultCategory())
|
||||||
if (libraryIsGrouped) {
|
if (libraryIsGrouped) {
|
||||||
categories.forEach { category ->
|
categories.forEach { category ->
|
||||||
val catId = category.id ?: return@forEach
|
val catId = category.id ?: return@forEach
|
||||||
if (catId > 0 && !categorySet.contains(catId) && (
|
if (catId > 0 && !categorySet.contains(catId) &&
|
||||||
catId !in categoriesHidden ||
|
(catId !in categoriesHidden || !showAll)
|
||||||
!showAll
|
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
val headerItem = headerItems[catId]
|
val headerItem = headerItems[catId]
|
||||||
if (headerItem != null) items.add(
|
if (headerItem != null) items.add(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue