From b44e0e76feb37f47118fd1bf83a62a4b2c960e9c Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Fri, 13 May 2022 21:33:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=B1=BB=E4=B8=8B=E8=BD=BD=E9=93=BE=E6=8E=A5=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/help/ruleHelp.md | 2 +- .../main/java/io/legado/app/data/entities/rule/BookInfoRule.kt | 3 ++- .../legado/app/ui/book/source/edit/BookSourceEditActivity.kt | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/assets/help/ruleHelp.md b/app/src/main/assets/help/ruleHelp.md index 4c406f7e8..9d3c6ade9 100644 --- a/app/src/main/assets/help/ruleHelp.md +++ b/app/src/main/assets/help/ruleHelp.md @@ -11,7 +11,7 @@ : regex规则,不可省略,只可以用在书籍列表和目录列表 ``` * 书源类型: 文件 -> 对于类似知轩藏书提供文件整合下载的网站,可以'在书源详情的目录URL规则获取文件链接,阅读会自动下载并导入 +> 对于类似知轩藏书提供文件整合下载的网站,可以'在书源详情的下载URL规则获取文件链接,支持多个链接,阅读会自动下载并导入 * CookieJar > 启用后会自动保存每次返回头中的Set-Cookie中的值,适用于验证码图片一类需要session的网站 diff --git a/app/src/main/java/io/legado/app/data/entities/rule/BookInfoRule.kt b/app/src/main/java/io/legado/app/data/entities/rule/BookInfoRule.kt index 9f3a0c9d0..cddba2c4f 100644 --- a/app/src/main/java/io/legado/app/data/entities/rule/BookInfoRule.kt +++ b/app/src/main/java/io/legado/app/data/entities/rule/BookInfoRule.kt @@ -16,5 +16,6 @@ data class BookInfoRule( var coverUrl: String? = null, var tocUrl: String? = null, var wordCount: String? = null, - var canReName: String? = null + var canReName: String? = null, + var downloadUrls: String? = null ) : Parcelable \ No newline at end of file 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 ab93ccc0e..ed991ff58 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 @@ -266,6 +266,7 @@ class BookSourceEditActivity : add(EditEntity("coverUrl", ir?.coverUrl, R.string.rule_cover_url)) add(EditEntity("tocUrl", ir?.tocUrl, R.string.rule_toc_url)) add(EditEntity("canReName", ir?.canReName, R.string.rule_can_re_name)) + add(EditEntity("downloadUrls", ir?.downloadUrls, R.string.download_url_rule)) } //目录页 val tr = source?.getTocRule() @@ -396,6 +397,7 @@ class BookSourceEditActivity : "tocUrl" -> bookInfoRule.tocUrl = viewModel.ruleComplete(it.value, bookInfoRule.init, 2) "canReName" -> bookInfoRule.canReName = it.value + "downloadUrls" -> bookInfoRule.downloadUrls = viewModel.ruleComplete(it.value, bookInfoRule.init) } } tocEntities.forEach {