diff --git a/app/src/main/java/io/legado/app/data/entities/BookSource.kt b/app/src/main/java/io/legado/app/data/entities/BookSource.kt index 70319d5f6..976d3fe96 100644 --- a/app/src/main/java/io/legado/app/data/entities/BookSource.kt +++ b/app/src/main/java/io/legado/app/data/entities/BookSource.kt @@ -26,11 +26,11 @@ data class BookSource( var customOrder: Int = 0, // 手动排序编号 var enabled: Boolean = true, // 是否启用 var enabledExplore: Boolean = true, // 启用发现 - override var concurrentRate: String? = null, //并发率 + override var concurrentRate: String? = null, // 并发率 override var header: String? = null, // 请求头 override var loginUrl: String? = null, // 登录地址 - override var loginUi: List? = null, //登录UI - var loginCheckJs: String? = null, //登录检测js + override var loginUi: List? = null, // 登录UI + var loginCheckJs: String? = null, // 登录检测js var bookSourceComment: String? = null, // 注释 var lastUpdateTime: Long = 0, // 最后更新时间,用于排序 var respondTime: Long = 180000L, // 响应时间,用于排序 diff --git a/app/src/main/java/io/legado/app/data/entities/rule/ContentRule.kt b/app/src/main/java/io/legado/app/data/entities/rule/ContentRule.kt index 7da6e9d57..197845cea 100644 --- a/app/src/main/java/io/legado/app/data/entities/rule/ContentRule.kt +++ b/app/src/main/java/io/legado/app/data/entities/rule/ContentRule.kt @@ -10,5 +10,6 @@ data class ContentRule( var webJs: String? = null, var sourceRegex: String? = null, var replaceRegex: String? = null, //替换规则 - var imageStyle: String? = null, //默认大小居中,FULL最大宽度 + var imageStyle: String? = null, //默认大小居中,FULL最大宽度 + var actions: String? = null //操作 ) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/data/entities/rule/RowUi.kt b/app/src/main/java/io/legado/app/data/entities/rule/RowUi.kt index 85258c754..e983d1a44 100644 --- a/app/src/main/java/io/legado/app/data/entities/rule/RowUi.kt +++ b/app/src/main/java/io/legado/app/data/entities/rule/RowUi.kt @@ -6,6 +6,6 @@ import kotlinx.parcelize.Parcelize @Parcelize data class RowUi( var name: String, - var type: String, + var type: String?, var action: String? ) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/data/entities/rule/SearchRule.kt b/app/src/main/java/io/legado/app/data/entities/rule/SearchRule.kt index 4c627cbc3..47969369f 100644 --- a/app/src/main/java/io/legado/app/data/entities/rule/SearchRule.kt +++ b/app/src/main/java/io/legado/app/data/entities/rule/SearchRule.kt @@ -6,6 +6,7 @@ import kotlinx.parcelize.Parcelize @Parcelize data class SearchRule( + var checkKeyWord: String? = null, // 校验关键字 override var bookList: String? = null, override var name: String? = null, override var author: String? = null, diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt index c24615b45..949e2ea8a 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt @@ -212,6 +212,7 @@ class BookSourceEditActivity : searchEntities.clear() searchEntities.apply { add(EditEntity("searchUrl", source?.searchUrl, R.string.r_search_url)) + add(EditEntity("checkKeyWord", sr?.checkKeyWord, R.string.check_key_word)) add(EditEntity("bookList", sr?.bookList, R.string.r_book_list)) add(EditEntity("name", sr?.name, R.string.r_book_name)) add(EditEntity("author", sr?.author, R.string.r_author)) @@ -222,6 +223,21 @@ class BookSourceEditActivity : add(EditEntity("coverUrl", sr?.coverUrl, R.string.rule_cover_url)) add(EditEntity("bookUrl", sr?.bookUrl, R.string.r_book_url)) } + //发现 + val er = source?.getExploreRule() + findEntities.clear() + findEntities.apply { + add(EditEntity("exploreUrl", source?.exploreUrl, R.string.r_find_url)) + add(EditEntity("bookList", er?.bookList, R.string.r_book_list)) + add(EditEntity("name", er?.name, R.string.r_book_name)) + add(EditEntity("author", er?.author, R.string.r_author)) + add(EditEntity("kind", er?.kind, R.string.rule_book_kind)) + add(EditEntity("wordCount", er?.wordCount, R.string.rule_word_count)) + add(EditEntity("lastChapter", er?.lastChapter, R.string.rule_last_chapter)) + add(EditEntity("intro", er?.intro, R.string.rule_book_intro)) + add(EditEntity("coverUrl", er?.coverUrl, R.string.rule_cover_url)) + add(EditEntity("bookUrl", er?.bookUrl, R.string.r_book_url)) + } //详情页 val ir = source?.getBookInfoRule() infoEntities.clear() @@ -258,21 +274,7 @@ class BookSourceEditActivity : add(EditEntity("sourceRegex", cr?.sourceRegex, R.string.rule_source_regex)) add(EditEntity("replaceRegex", cr?.replaceRegex, R.string.rule_replace_regex)) add(EditEntity("imageStyle", cr?.imageStyle, R.string.rule_image_style)) - } - //发现 - val er = source?.getExploreRule() - findEntities.clear() - findEntities.apply { - add(EditEntity("exploreUrl", source?.exploreUrl, R.string.r_find_url)) - add(EditEntity("bookList", er?.bookList, R.string.r_book_list)) - add(EditEntity("name", er?.name, R.string.r_book_name)) - add(EditEntity("author", er?.author, R.string.r_author)) - add(EditEntity("kind", er?.kind, R.string.rule_book_kind)) - add(EditEntity("wordCount", er?.wordCount, R.string.rule_word_count)) - add(EditEntity("lastChapter", er?.lastChapter, R.string.rule_last_chapter)) - add(EditEntity("intro", er?.intro, R.string.rule_book_intro)) - add(EditEntity("coverUrl", er?.coverUrl, R.string.rule_cover_url)) - add(EditEntity("bookUrl", er?.bookUrl, R.string.r_book_url)) + add(EditEntity("actions", cr?.actions, R.string.rule_actions)) } binding.tabLayout.selectTab(binding.tabLayout.getTabAt(0)) setEditEntities(0) @@ -305,6 +307,7 @@ class BookSourceEditActivity : searchEntities.forEach { when (it.key) { "searchUrl" -> source.searchUrl = it.value + "checkKeyWord" -> searchRule.checkKeyWord = it.value "bookList" -> searchRule.bookList = it.value "name" -> searchRule.name = it.value "author" -> searchRule.author = it.value @@ -365,6 +368,7 @@ class BookSourceEditActivity : "sourceRegex" -> contentRule.sourceRegex = it.value "replaceRegex" -> contentRule.replaceRegex = it.value "imageStyle" -> contentRule.imageStyle = it.value + "actions" -> contentRule.actions = it.value } } source.ruleSearch = searchRule diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index 29db8c859..0c83008ae 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -874,4 +874,6 @@ 拷贝播放Url 设置源变量 设置书籍变量 + 校验关键字 + 操作(actions) diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index 75bf1aab9..659ffe49f 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -874,4 +874,6 @@ 拷贝播放Url 设置源变量 设置书籍变量 + 校验关键字 + 操作(actions) diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 192b5742b..10d44b30e 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -874,5 +874,7 @@ 拷贝播放Url 设置源变量 设置书籍变量 + 校验关键字 + 操作(actions) diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index f60da25d3..64115feec 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -871,5 +871,7 @@ 拷贝播放Url 设置源变量 设置书籍变量 + 校验关键字 + 操作(actions) diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 85ec7a585..18c07324a 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -873,5 +873,7 @@ 複製播放Url 設定源變數 設定書籍變數 + 校验关键字 + 操作(actions) diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index aa291b690..a39f3e876 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -873,5 +873,7 @@ 拷贝播放Url 设置源变量 设置书籍变量 + 校验关键字 + 操作(actions) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f1a46592a..8110355ec 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -874,5 +874,7 @@ 拷贝播放Url 设置源变量 设置书籍变量 + 校验关键字 + 操作(actions)