mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 02:34:39 +00:00
fix(library): Don't show Default category if it's empty
This commit is contained in:
parent
365d259e94
commit
90f5dfc55a
1 changed files with 6 additions and 7 deletions
|
@ -813,12 +813,11 @@ class LibraryPresenter(
|
||||||
groupType = prefs.groupType
|
groupType = prefs.groupType
|
||||||
|
|
||||||
val defaultCategory = createDefaultCategory()
|
val defaultCategory = createDefaultCategory()
|
||||||
val allCategories = listOf(defaultCategory) + dbCategories
|
|
||||||
|
|
||||||
// FIXME: Should return Map<Int, LibraryItem> where Int is category id
|
// FIXME: Should return Map<Int, LibraryItem> where Int is category id
|
||||||
if (groupType <= BY_DEFAULT || !libraryIsGrouped) {
|
if (groupType <= BY_DEFAULT || !libraryIsGrouped) {
|
||||||
getLibraryItems(
|
getLibraryItems(
|
||||||
allCategories, // FIXME: Don't depends on allCategories
|
dbCategories,
|
||||||
libraryMangaList,
|
libraryMangaList,
|
||||||
prefs.sortingMode,
|
prefs.sortingMode,
|
||||||
prefs.sortAscending,
|
prefs.sortAscending,
|
||||||
|
@ -834,7 +833,7 @@ class LibraryPresenter(
|
||||||
groupType,
|
groupType,
|
||||||
prefs.collapsedDynamicCategories,
|
prefs.collapsedDynamicCategories,
|
||||||
)
|
)
|
||||||
} to allCategories
|
} to listOf(defaultCategory) + dbCategories
|
||||||
}
|
}
|
||||||
|
|
||||||
return combine(
|
return combine(
|
||||||
|
@ -884,10 +883,10 @@ class LibraryPresenter(
|
||||||
} + (-1 to catItemAll) + (0 to LibraryHeaderItem({ categories.getOrDefault(0) }, 0))
|
} + (-1 to catItemAll) + (0 to LibraryHeaderItem({ categories.getOrDefault(0) }, 0))
|
||||||
).toMap()
|
).toMap()
|
||||||
|
|
||||||
// TODO
|
// TODO: -
|
||||||
val map = libraryManga.groupBy {
|
// val map = libraryManga.groupBy {
|
||||||
categories.getOrDefault(it.category)
|
// categories.getOrDefault(it.category)
|
||||||
}
|
// }
|
||||||
|
|
||||||
val items = if (libraryIsGrouped) {
|
val items = if (libraryIsGrouped) {
|
||||||
libraryManga
|
libraryManga
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue