From 7c8ff1ecefd69c89cc35ee10606d25e8d3601938 Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 16 Sep 2021 17:56:28 +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/ReplaceRuleDao.kt | 3 +++ .../io/legado/app/ui/association/ImportReplaceRuleDialog.kt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/data/dao/ReplaceRuleDao.kt b/app/src/main/java/io/legado/app/data/dao/ReplaceRuleDao.kt index b82014839..891e0bf77 100644 --- a/app/src/main/java/io/legado/app/data/dao/ReplaceRuleDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/ReplaceRuleDao.kt @@ -29,6 +29,9 @@ interface ReplaceRuleDao { @get:Query("SELECT * FROM replace_rules ORDER BY sortOrder ASC") val all: List + @get:Query("select distinct `group` from replace_rules where trim(`group`) <> ''") + val allGroup: List + @get:Query("SELECT * FROM replace_rules WHERE isEnabled = 1 ORDER BY sortOrder ASC") val allEnabled: List diff --git a/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleDialog.kt b/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleDialog.kt index 1c491f651..12ff6517f 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleDialog.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleDialog.kt @@ -146,7 +146,7 @@ class ImportReplaceRuleDialog() : BaseDialogFragment(), Toolbar.OnMenuItemClickL alert(R.string.diy_edit_source_group) { val alertBinding = DialogCustomGroupBinding.inflate(layoutInflater).apply { val groups = linkedSetOf() - appDb.bookSourceDao.allGroup.forEach { group -> + appDb.replaceRuleDao.allGroup.forEach { group -> groups.addAll(group.splitNotBlank(AppPattern.splitGroupRegex)) } textInputLayout.setHint(R.string.group_name)