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 bc39446a9..0bf72284b 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 @@ -51,6 +51,7 @@ interface ReplaceRuleDao { @Query( """SELECT * FROM replace_rules WHERE isEnabled = 1 and scopeContent = 1 AND (scope LIKE '%' || :name || '%' or scope LIKE '%' || :origin || '%' or scope is null or scope = '') + and (excludeScope is null or (excludeScope not LIKE '%' || :name || '%' and excludeScope not LIKE '%' || :origin || '%')) order by sortOrder""" ) fun findEnabledByContentScope(name: String, origin: String): List @@ -58,6 +59,7 @@ interface ReplaceRuleDao { @Query( """SELECT * FROM replace_rules WHERE isEnabled = 1 and scopeTitle = 1 AND (scope LIKE '%' || :name || '%' or scope LIKE '%' || :origin || '%' or scope is null or scope = '') + and (excludeScope is null or (excludeScope not LIKE '%' || :name || '%' and excludeScope not LIKE '%' || :origin || '%')) order by sortOrder""" ) fun findEnabledByTitleScope(name: String, origin: String): List diff --git a/app/src/main/java/io/legado/app/ui/replace/edit/ReplaceEditActivity.kt b/app/src/main/java/io/legado/app/ui/replace/edit/ReplaceEditActivity.kt index 73204c1a7..74ef5b456 100644 --- a/app/src/main/java/io/legado/app/ui/replace/edit/ReplaceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/replace/edit/ReplaceEditActivity.kt @@ -95,6 +95,7 @@ class ReplaceEditActivity : cbScopeTitle.isChecked = replaceRule.scopeTitle cbScopeContent.isChecked = replaceRule.scopeContent etScope.setText(replaceRule.scope) + etExcludeScope.setText(replaceRule.excludeScope) etTimeout.setText(replaceRule.timeoutMillisecond.toString()) } @@ -108,6 +109,7 @@ class ReplaceEditActivity : replaceRule.scopeTitle = cbScopeTitle.isChecked replaceRule.scopeContent = cbScopeContent.isChecked replaceRule.scope = etScope.text.toString() + replaceRule.excludeScope = etExcludeScope.text.toString() replaceRule.timeoutMillisecond = etTimeout.text.toString().ifEmpty { "3000" }.toLong() return replaceRule } diff --git a/app/src/main/res/layout/activity_replace_edit.xml b/app/src/main/res/layout/activity_replace_edit.xml index 7d15630f8..0a508c428 100644 --- a/app/src/main/res/layout/activity_replace_edit.xml +++ b/app/src/main/res/layout/activity_replace_edit.xml @@ -139,6 +139,19 @@ tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" /> + + + + + 本地备份仅保留最新备份文件 Fail to authorize WebDav application Cargar palabras del libro + 排除范围 diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index 405da1bd4..8cdeb1952 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -1104,4 +1104,5 @@ 本地备份仅保留最新备份文件 Fail to authorize WebDav application Load word count + 排除范围 diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index a9d08590a..662c75414 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -1104,4 +1104,5 @@ 本地备份仅保留最新备份文件 Fail to authorize WebDav application Carregar os palavras do livro + 排除范围 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index b52a94550..009025c68 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -1101,4 +1101,5 @@ 本地备份仅保留最新备份文件 webDav应用验证失败 加載字數 + 排除范围 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 365484f36..c88d803ba 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -1103,4 +1103,5 @@ 本地备份仅保留最新备份文件 webDav应用验证失败 加載字數 + 排除范围 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 3c2bd6d67..964d3369b 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -1103,4 +1103,5 @@ 本地备份仅保留最新备份文件 webDav应用验证失败 加载字数 + 排除范围 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4665aea79..ab95a6c9c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1104,4 +1104,5 @@ Fail to authorize WebDav application respondTime: %1$d ms Load word count + 排除范围