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