diff --git a/app/src/main/java/io/legado/app/data/dao/BookSourceDao.kt b/app/src/main/java/io/legado/app/data/dao/BookSourceDao.kt index f7c4a764c..9e0ec4dbc 100644 --- a/app/src/main/java/io/legado/app/data/dao/BookSourceDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/BookSourceDao.kt @@ -98,7 +98,7 @@ interface BookSourceDao { and trim(bookSourceGroup) <> '' order by customOrder""" ) - fun flowExploreGroupUnProcessed(): Flow> + fun flowExploreGroupsUnProcessed(): Flow> @Query("select * from book_sources where bookSourceGroup like '%' || :group || '%'") fun getByGroup(group: String): List @@ -181,8 +181,8 @@ interface BookSourceDao { } } - fun flowExploreGroup(): Flow> { - return flowExploreGroupUnProcessed().map { list -> + fun flowExploreGroups(): Flow> { + return flowExploreGroupsUnProcessed().map { list -> dealGroups(list) } } diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt index 21b0e0b4c..46b1cd1c1 100644 --- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt @@ -106,7 +106,7 @@ class ExploreFragment : VMBaseFragment(R.layout.fragment_explo private fun initGroupData() { launch { - appDb.bookSourceDao.flowExploreGroup().conflate().collect { + appDb.bookSourceDao.flowExploreGroups().conflate().collect { groups.clear() groups.addAll(it) upGroupsMenu()