From 651d501ff4b15850794e90c9f904ba9b01407a80 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 28 Feb 2022 15:34:55 +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/help/RuleComplete.kt | 6 +----- .../app/ui/book/source/edit/BookSourceEditViewModel.kt | 5 ++++- .../legado/app/ui/rss/source/edit/RssSourceEditViewModel.kt | 5 ++++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/RuleComplete.kt b/app/src/main/java/io/legado/app/help/RuleComplete.kt index cbdc6b4ed..5ac274aa0 100644 --- a/app/src/main/java/io/legado/app/help/RuleComplete.kt +++ b/app/src/main/java/io/legado/app/help/RuleComplete.kt @@ -36,12 +36,8 @@ object RuleComplete { fun autoComplete( rule: String?, preRule: String? = null, - type: Int = 1, - enable: Boolean + type: Int = 1 ): String? { - if (!enable) { - return rule - } if (rule.isNullOrEmpty() || rule.contains(completeIgnore) || preRule?.contains(completeIgnorePreRule) == true ) { diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditViewModel.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditViewModel.kt index 03683d51f..b471c1001 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditViewModel.kt @@ -98,7 +98,10 @@ class BookSourceEditViewModel(application: Application) : BaseViewModel(applicat } fun ruleComplete(rule: String?, preRule: String? = null, type: Int = 1): String? { - return RuleComplete.autoComplete(rule, preRule, type, autoComplete) + if (autoComplete) { + return RuleComplete.autoComplete(rule, preRule, type) + } + return rule } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditViewModel.kt b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditViewModel.kt index b37bcfc2d..75634c2a1 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditViewModel.kt @@ -78,7 +78,10 @@ class RssSourceEditViewModel(application: Application) : BaseViewModel(applicati } fun ruleComplete(rule: String?, preRule: String? = null, type: Int = 1): String? { - return RuleComplete.autoComplete(rule, preRule, type, autoComplete) + if (autoComplete) { + return RuleComplete.autoComplete(rule, preRule, type) + } + return rule } } \ No newline at end of file