mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-24 17:21:53 +01:00
Fixes for showing single category
This commit is contained in:
parent
bc8ed36d1c
commit
d73579d25a
@ -431,6 +431,7 @@ class LibraryPresenter(
|
||||
val categories = db.getCategories().executeAsBlocking().toMutableList()
|
||||
val showCategories = !preferences.hideCategories().getOrDefault()
|
||||
var libraryManga = db.getLibraryMangas().executeAsBlocking()
|
||||
val showAll = showAllCategories
|
||||
if (groupType <= BY_DEFAULT || !showCategories) {
|
||||
libraryManga = libraryManga.distinctBy { it.id }
|
||||
}
|
||||
@ -465,12 +466,12 @@ class LibraryPresenter(
|
||||
categories.forEach { category ->
|
||||
val catId = category.id ?: return@forEach
|
||||
if (catId > 0 && !categorySet.contains(catId) && (catId !in categoriesHidden ||
|
||||
!showCategories)) {
|
||||
!showAll)) {
|
||||
val headerItem = headerItems[catId]
|
||||
if (headerItem != null) items.add(
|
||||
LibraryItem(LibraryManga.createBlank(catId), headerItem)
|
||||
)
|
||||
} else if (catId in categoriesHidden && showCategories && categories.size > 1) {
|
||||
} else if (catId in categoriesHidden && showAll && categories.size > 1) {
|
||||
val mangaToRemove = items.filter { it.manga.category == catId }
|
||||
val mergedTitle = mangaToRemove.joinToString("-") {
|
||||
it.manga.title + "-" + it.manga.author
|
||||
@ -486,7 +487,7 @@ class LibraryPresenter(
|
||||
}
|
||||
|
||||
categories.forEach {
|
||||
it.isHidden = it.id in categoriesHidden && showCategories
|
||||
it.isHidden = it.id in categoriesHidden && showAll && categories.size > 1
|
||||
}
|
||||
this.categories = if (!showCategories) {
|
||||
arrayListOf(categoryAll)
|
||||
|
Loading…
Reference in New Issue
Block a user