pull/1319/head
gedoor 3 years ago
parent 2eadb93340
commit 7c8ff1ecef
  1. 3
      app/src/main/java/io/legado/app/data/dao/ReplaceRuleDao.kt
  2. 2
      app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleDialog.kt

@ -29,6 +29,9 @@ interface ReplaceRuleDao {
@get:Query("SELECT * FROM replace_rules ORDER BY sortOrder ASC")
val all: List<ReplaceRule>
@get:Query("select distinct `group` from replace_rules where trim(`group`) <> ''")
val allGroup: List<String>
@get:Query("SELECT * FROM replace_rules WHERE isEnabled = 1 ORDER BY sortOrder ASC")
val allEnabled: List<ReplaceRule>

@ -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<String>()
appDb.bookSourceDao.allGroup.forEach { group ->
appDb.replaceRuleDao.allGroup.forEach { group ->
groups.addAll(group.splitNotBlank(AppPattern.splitGroupRegex))
}
textInputLayout.setHint(R.string.group_name)

Loading…
Cancel
Save