|
@@ -9,7 +9,6 @@ import io.legado.app.data.appDb
|
|
|
import io.legado.app.data.entities.ReplaceRule
|
|
import io.legado.app.data.entities.ReplaceRule
|
|
|
import io.legado.app.exception.NoStackTraceException
|
|
import io.legado.app.exception.NoStackTraceException
|
|
|
import io.legado.app.help.ReplaceAnalyzer
|
|
import io.legado.app.help.ReplaceAnalyzer
|
|
|
-import io.legado.app.help.config.AppConfig
|
|
|
|
|
import io.legado.app.help.http.newCallResponseBody
|
|
import io.legado.app.help.http.newCallResponseBody
|
|
|
import io.legado.app.help.http.okHttpClient
|
|
import io.legado.app.help.http.okHttpClient
|
|
|
import io.legado.app.help.http.text
|
|
import io.legado.app.help.http.text
|
|
@@ -52,18 +51,10 @@ class ImportReplaceRuleViewModel(app: Application) : BaseViewModel(app) {
|
|
|
fun importSelect(finally: () -> Unit) {
|
|
fun importSelect(finally: () -> Unit) {
|
|
|
execute {
|
|
execute {
|
|
|
val group = groupName?.trim()
|
|
val group = groupName?.trim()
|
|
|
- val keepName = AppConfig.importKeepName
|
|
|
|
|
val selectRules = arrayListOf<ReplaceRule>()
|
|
val selectRules = arrayListOf<ReplaceRule>()
|
|
|
selectStatus.forEachIndexed { index, b ->
|
|
selectStatus.forEachIndexed { index, b ->
|
|
|
if (b) {
|
|
if (b) {
|
|
|
val rule = allRules[index]
|
|
val rule = allRules[index]
|
|
|
- if (keepName) {
|
|
|
|
|
- checkRules[index]?.let {
|
|
|
|
|
- rule.name = it.name
|
|
|
|
|
- rule.group = it.group
|
|
|
|
|
- rule.order = it.order
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
if (!group.isNullOrEmpty()) {
|
|
if (!group.isNullOrEmpty()) {
|
|
|
if (isAddGroup) {
|
|
if (isAddGroup) {
|
|
|
val groups = linkedSetOf<String>()
|
|
val groups = linkedSetOf<String>()
|