From 54006c3831539d86001db33e2ae85fcefe26d52d Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 27 Feb 2021 10:02:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E8=B7=B3=E5=88=B0=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E6=97=B6=E5=86=99=E5=85=A5=E7=9B=AE=E5=BD=95?= =?UTF-8?q?url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/model/analyzeRule/AnalyzeRule.kt | 6 +++--- app/src/main/java/io/legado/app/model/webBook/BookList.kt | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt index b1dce05fa..b408f1a86 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt @@ -28,9 +28,9 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions { var book: BaseBook? = null var chapter: BookChapter? = null var nextChapterUrl: String? = null - private var content: Any? = null - private var baseUrl: String? = null - private var redirectUrl: URL? = null + var content: Any? = null + var baseUrl: String? = null + var redirectUrl: URL? = null private var isJSON: Boolean = false private var isRegex: Boolean = false diff --git a/app/src/main/java/io/legado/app/model/webBook/BookList.kt b/app/src/main/java/io/legado/app/model/webBook/BookList.kt index c486c6e98..68182a693 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookList.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookList.kt @@ -168,6 +168,13 @@ object BookList { Debug.log(bookSource.bookSourceUrl, "┌获取封面链接") searchBook.coverUrl = analyzeRule.getString(coverUrl, true) Debug.log(bookSource.bookSourceUrl, "└${searchBook.coverUrl}") + Debug.log(bookSource.bookSourceUrl, "┌获取目录链接") + searchBook.tocUrl = analyzeRule.getString(tocUrl, true) + if (searchBook.tocUrl.isEmpty()) searchBook.tocUrl = baseUrl + if (searchBook.tocUrl == baseUrl) { + searchBook.tocHtml = analyzeRule.content.toString() + } + Debug.log(bookSource.bookSourceUrl, "└${searchBook.tocUrl}") return searchBook } }