From 0e5dce5c4d66f7e305103fefd3bde2a1417a9582 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 12 Sep 2022 19:51:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/data/dao/BookSourceDao.kt | 6 +++--- .../java/io/legado/app/ui/main/explore/ExploreFragment.kt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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()