mirror of
https://github.com/null2264/yokai.git
synced 2025-06-20 18:24:42 +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
|
||||
|
||||
val defaultCategory = createDefaultCategory()
|
||||
val allCategories = listOf(defaultCategory) + dbCategories
|
||||
|
||||
// FIXME: Should return Map<Int, LibraryItem> where Int is category id
|
||||
if (groupType <= BY_DEFAULT || !libraryIsGrouped) {
|
||||
getLibraryItems(
|
||||
allCategories, // FIXME: Don't depends on allCategories
|
||||
dbCategories,
|
||||
libraryMangaList,
|
||||
prefs.sortingMode,
|
||||
prefs.sortAscending,
|
||||
|
@ -834,7 +833,7 @@ class LibraryPresenter(
|
|||
groupType,
|
||||
prefs.collapsedDynamicCategories,
|
||||
)
|
||||
} to allCategories
|
||||
} to listOf(defaultCategory) + dbCategories
|
||||
}
|
||||
|
||||
return combine(
|
||||
|
@ -884,10 +883,10 @@ class LibraryPresenter(
|
|||
} + (-1 to catItemAll) + (0 to LibraryHeaderItem({ categories.getOrDefault(0) }, 0))
|
||||
).toMap()
|
||||
|
||||
// TODO
|
||||
val map = libraryManga.groupBy {
|
||||
categories.getOrDefault(it.category)
|
||||
}
|
||||
// TODO: -
|
||||
// val map = libraryManga.groupBy {
|
||||
// categories.getOrDefault(it.category)
|
||||
// }
|
||||
|
||||
val items = if (libraryIsGrouped) {
|
||||
libraryManga
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue