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 e1f181adb..100a58694 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 @@ -86,7 +86,7 @@ interface BookSourceDao { fun flowGroupExplore(key: String): Flow> @Query("select distinct bookSourceGroup from book_sources where trim(bookSourceGroup) <> ''") - fun flowGroupsUnDeal(): Flow> + fun flowGroupsUnProcessed(): Flow> @Query("select distinct bookSourceGroup from book_sources where enabled = 1 and trim(bookSourceGroup) <> ''") fun flowGroupEnabled(): Flow> @@ -132,7 +132,7 @@ interface BookSourceDao { val allTextEnabled: List @Query("select distinct bookSourceGroup from book_sources where trim(bookSourceGroup) <> ''") - fun getAllGroupsUnDeal(): List + fun getAllGroupsUnProcessed(): List @Query("select * from book_sources where bookSourceUrl = :key") fun getBookSource(key: String): BookSource? @@ -172,11 +172,11 @@ interface BookSourceDao { val allGroups: List get() { - return dealGroups(getAllGroupsUnDeal()) + return dealGroups(getAllGroupsUnProcessed()) } fun flowGroups(): Flow> { - return flowGroupsUnDeal().map { list -> + return flowGroupsUnProcessed().map { list -> dealGroups(list) } } diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt index e62848eb0..7dedd8c33 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt @@ -506,13 +506,21 @@ class BookSourceEditActivity : SelectItem("书源教程", "ruleHelp"), SelectItem("js教程", "jsHelp"), SelectItem("正则教程", "regexHelp"), - SelectItem("选择文件", "selectFile"), ) val view = window.decorView.findFocus() - if (view is EditText && view.getTag(R.id.tag) == "bookSourceGroup") { - helpActions.add( - SelectItem("插入分组", "addGroup") - ) + if (view is EditText) { + when (view.getTag(R.id.tag)) { + "bookSourceGroup" -> { + helpActions.add( + SelectItem("插入分组", "addGroup") + ) + } + else -> { + helpActions.add( + SelectItem("选择文件", "selectFile") + ) + } + } } return helpActions }