mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -98,7 +98,7 @@ interface BookSourceDao {
|
||||
and trim(bookSourceGroup) <> ''
|
||||
order by customOrder"""
|
||||
)
|
||||
fun flowExploreGroupUnProcessed(): Flow<List<String>>
|
||||
fun flowExploreGroupsUnProcessed(): Flow<List<String>>
|
||||
|
||||
@Query("select * from book_sources where bookSourceGroup like '%' || :group || '%'")
|
||||
fun getByGroup(group: String): List<BookSource>
|
||||
@@ -181,8 +181,8 @@ interface BookSourceDao {
|
||||
}
|
||||
}
|
||||
|
||||
fun flowExploreGroup(): Flow<List<String>> {
|
||||
return flowExploreGroupUnProcessed().map { list ->
|
||||
fun flowExploreGroups(): Flow<List<String>> {
|
||||
return flowExploreGroupsUnProcessed().map { list ->
|
||||
dealGroups(list)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ class ExploreFragment : VMBaseFragment<ExploreViewModel>(R.layout.fragment_explo
|
||||
|
||||
private fun initGroupData() {
|
||||
launch {
|
||||
appDb.bookSourceDao.flowExploreGroup().conflate().collect {
|
||||
appDb.bookSourceDao.flowExploreGroups().conflate().collect {
|
||||
groups.clear()
|
||||
groups.addAll(it)
|
||||
upGroupsMenu()
|
||||
|
||||
Reference in New Issue
Block a user