|
|
@ -21,6 +21,7 @@ import io.legado.app.data.entities.BookSource |
|
|
|
import io.legado.app.data.entities.rule.* |
|
|
|
import io.legado.app.data.entities.rule.* |
|
|
|
import io.legado.app.databinding.ActivityBookSourceEditBinding |
|
|
|
import io.legado.app.databinding.ActivityBookSourceEditBinding |
|
|
|
import io.legado.app.help.LocalConfig |
|
|
|
import io.legado.app.help.LocalConfig |
|
|
|
|
|
|
|
import io.legado.app.help.ruleComplete |
|
|
|
import io.legado.app.lib.dialogs.alert |
|
|
|
import io.legado.app.lib.dialogs.alert |
|
|
|
import io.legado.app.lib.dialogs.selector |
|
|
|
import io.legado.app.lib.dialogs.selector |
|
|
|
import io.legado.app.lib.theme.backgroundColor |
|
|
|
import io.legado.app.lib.theme.backgroundColor |
|
|
@ -327,63 +328,63 @@ class BookSourceEditActivity : |
|
|
|
"searchUrl" -> source.searchUrl = it.value |
|
|
|
"searchUrl" -> source.searchUrl = it.value |
|
|
|
"checkKeyWord" -> searchRule.checkKeyWord = it.value |
|
|
|
"checkKeyWord" -> searchRule.checkKeyWord = it.value |
|
|
|
"bookList" -> searchRule.bookList = it.value |
|
|
|
"bookList" -> searchRule.bookList = it.value |
|
|
|
"name" -> searchRule.name = it.value |
|
|
|
"name" -> searchRule.name = ruleComplete(it.value) |
|
|
|
"author" -> searchRule.author = it.value |
|
|
|
"author" -> searchRule.author = ruleComplete(it.value) |
|
|
|
"kind" -> searchRule.kind = it.value |
|
|
|
"kind" -> searchRule.kind = ruleComplete(it.value) |
|
|
|
"intro" -> searchRule.intro = it.value |
|
|
|
"intro" -> searchRule.intro = ruleComplete(it.value) |
|
|
|
"updateTime" -> searchRule.updateTime = it.value |
|
|
|
"updateTime" -> searchRule.updateTime = ruleComplete(it.value) |
|
|
|
"wordCount" -> searchRule.wordCount = it.value |
|
|
|
"wordCount" -> searchRule.wordCount = ruleComplete(it.value) |
|
|
|
"lastChapter" -> searchRule.lastChapter = it.value |
|
|
|
"lastChapter" -> searchRule.lastChapter = ruleComplete(it.value) |
|
|
|
"coverUrl" -> searchRule.coverUrl = it.value |
|
|
|
"coverUrl" -> searchRule.coverUrl = ruleComplete(it.value,type=3) |
|
|
|
"bookUrl" -> searchRule.bookUrl = it.value |
|
|
|
"bookUrl" -> searchRule.bookUrl = ruleComplete(it.value,type=2) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
findEntities.forEach { |
|
|
|
findEntities.forEach { |
|
|
|
when (it.key) { |
|
|
|
when (it.key) { |
|
|
|
"exploreUrl" -> source.exploreUrl = it.value |
|
|
|
"exploreUrl" -> source.exploreUrl = it.value |
|
|
|
"bookList" -> exploreRule.bookList = it.value |
|
|
|
"bookList" -> exploreRule.bookList = it.value |
|
|
|
"name" -> exploreRule.name = it.value |
|
|
|
"name" -> exploreRule.name = ruleComplete(it.value) |
|
|
|
"author" -> exploreRule.author = it.value |
|
|
|
"author" -> exploreRule.author = ruleComplete(it.value) |
|
|
|
"kind" -> exploreRule.kind = it.value |
|
|
|
"kind" -> exploreRule.kind = ruleComplete(it.value) |
|
|
|
"intro" -> exploreRule.intro = it.value |
|
|
|
"intro" -> exploreRule.intro = ruleComplete(it.value) |
|
|
|
"updateTime" -> exploreRule.updateTime = it.value |
|
|
|
"updateTime" -> exploreRule.updateTime = ruleComplete(it.value) |
|
|
|
"wordCount" -> exploreRule.wordCount = it.value |
|
|
|
"wordCount" -> exploreRule.wordCount = ruleComplete(it.value) |
|
|
|
"lastChapter" -> exploreRule.lastChapter = it.value |
|
|
|
"lastChapter" -> exploreRule.lastChapter = ruleComplete(it.value) |
|
|
|
"coverUrl" -> exploreRule.coverUrl = it.value |
|
|
|
"coverUrl" -> exploreRule.coverUrl = ruleComplete(it.value,type=3) |
|
|
|
"bookUrl" -> exploreRule.bookUrl = it.value |
|
|
|
"bookUrl" -> exploreRule.bookUrl = ruleComplete(it.value,type=2) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
infoEntities.forEach { |
|
|
|
infoEntities.forEach { |
|
|
|
when (it.key) { |
|
|
|
when (it.key) { |
|
|
|
"init" -> bookInfoRule.init = it.value |
|
|
|
"init" -> bookInfoRule.init = it.value ?: "" |
|
|
|
"name" -> bookInfoRule.name = it.value |
|
|
|
"name" -> bookInfoRule.name = ruleComplete(it.value,bookInfoRule.init) |
|
|
|
"author" -> bookInfoRule.author = it.value |
|
|
|
"author" -> bookInfoRule.author = ruleComplete(it.value,bookInfoRule.init) |
|
|
|
"kind" -> bookInfoRule.kind = it.value |
|
|
|
"kind" -> bookInfoRule.kind = ruleComplete(it.value,bookInfoRule.init) |
|
|
|
"intro" -> bookInfoRule.intro = it.value |
|
|
|
"intro" -> bookInfoRule.intro = ruleComplete(it.value,bookInfoRule.init) |
|
|
|
"updateTime" -> bookInfoRule.updateTime = it.value |
|
|
|
"updateTime" -> bookInfoRule.updateTime = ruleComplete(it.value,bookInfoRule.init) |
|
|
|
"wordCount" -> bookInfoRule.wordCount = it.value |
|
|
|
"wordCount" -> bookInfoRule.wordCount = ruleComplete(it.value,bookInfoRule.init) |
|
|
|
"lastChapter" -> bookInfoRule.lastChapter = it.value |
|
|
|
"lastChapter" -> bookInfoRule.lastChapter = ruleComplete(it.value,bookInfoRule.init) |
|
|
|
"coverUrl" -> bookInfoRule.coverUrl = it.value |
|
|
|
"coverUrl" -> bookInfoRule.coverUrl = ruleComplete(it.value,bookInfoRule.init,3) |
|
|
|
"tocUrl" -> bookInfoRule.tocUrl = it.value |
|
|
|
"tocUrl" -> bookInfoRule.tocUrl = ruleComplete(it.value,bookInfoRule.init,2) |
|
|
|
"canReName" -> bookInfoRule.canReName = it.value |
|
|
|
"canReName" -> bookInfoRule.canReName = it.value |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
tocEntities.forEach { |
|
|
|
tocEntities.forEach { |
|
|
|
when (it.key) { |
|
|
|
when (it.key) { |
|
|
|
"chapterList" -> tocRule.chapterList = it.value |
|
|
|
"chapterList" -> tocRule.chapterList = it.value |
|
|
|
"chapterName" -> tocRule.chapterName = it.value |
|
|
|
"chapterName" -> tocRule.chapterName = ruleComplete(it.value) |
|
|
|
"chapterUrl" -> tocRule.chapterUrl = it.value |
|
|
|
"chapterUrl" -> tocRule.chapterUrl = ruleComplete(it.value,type=2) |
|
|
|
"isVolume" -> tocRule.isVolume = it.value |
|
|
|
"isVolume" -> tocRule.isVolume = it.value |
|
|
|
"updateTime" -> tocRule.updateTime = it.value |
|
|
|
"updateTime" -> tocRule.updateTime = it.value |
|
|
|
"isVip" -> tocRule.isVip = it.value |
|
|
|
"isVip" -> tocRule.isVip = it.value |
|
|
|
"isPay" -> tocRule.isPay = it.value |
|
|
|
"isPay" -> tocRule.isPay = it.value |
|
|
|
"nextTocUrl" -> tocRule.nextTocUrl = it.value |
|
|
|
"nextTocUrl" -> tocRule.nextTocUrl = ruleComplete(it.value,type=2) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
contentEntities.forEach { |
|
|
|
contentEntities.forEach { |
|
|
|
when (it.key) { |
|
|
|
when (it.key) { |
|
|
|
"content" -> contentRule.content = it.value |
|
|
|
"content" -> contentRule.content = ruleComplete(it.value) |
|
|
|
"nextContentUrl" -> contentRule.nextContentUrl = it.value |
|
|
|
"nextContentUrl" -> contentRule.nextContentUrl = ruleComplete(it.value,type=2) |
|
|
|
"webJs" -> contentRule.webJs = it.value |
|
|
|
"webJs" -> contentRule.webJs = it.value |
|
|
|
"sourceRegex" -> contentRule.sourceRegex = it.value |
|
|
|
"sourceRegex" -> contentRule.sourceRegex = it.value |
|
|
|
"replaceRegex" -> contentRule.replaceRegex = it.value |
|
|
|
"replaceRegex" -> contentRule.replaceRegex = it.value |
|
|
@ -485,5 +486,4 @@ class BookSourceEditActivity : |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|