Skip to content

fix: skip empty categories when building catalog#44

Merged
kdroidFilter merged 1 commit intodevfrom
fix/skip-empty-categories-in-catalog
Jan 24, 2026
Merged

fix: skip empty categories when building catalog#44
kdroidFilter merged 1 commit intodevfrom
fix/skip-empty-categories-in-catalog

Conversation

@kdroidFilter
Copy link
Owner

@kdroidFilter kdroidFilter commented Jan 24, 2026

Summary

  • Categories that have no books and no non-empty subcategories are now excluded from the precomputed catalog
  • This fixes the issue where blacklisted books would leave empty category folders in the tree

Changes

  • Modified BuildCatalog.kt to filter out empty categories recursively using mapNotNull

Test plan

  • Run ./gradlew :catalog:buildCatalog
  • Verify no empty folders appear in the catalog tree

Categories that have no books and no non-empty subcategories are now
excluded from the precomputed catalog. This fixes the issue where
blacklisted books would leave empty category folders in the tree.

The fix works recursively: if a category's only children are themselves
empty, the parent category is also excluded.
@kdroidFilter kdroidFilter merged commit da06691 into dev Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant