From 6149fbfdc924b3fc85692757aee3523a8031aca2 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 6 Nov 2019 13:20:49 +0800 Subject: [PATCH] up --- .../java/io/legado/app/data/entities/BookSource.kt | 10 +++++----- app/src/main/java/io/legado/app/model/Rss.kt | 2 +- app/src/main/java/io/legado/app/model/WebBook.kt | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) 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 20965dbf7..aada00709 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 @@ -48,23 +48,23 @@ data class BookSource( ) : Parcelable { @Ignore @IgnoredOnParcel - var searchRuleV: SearchRule? = null + private var searchRuleV: SearchRule? = null @Ignore @IgnoredOnParcel - var exploreRuleV: ExploreRule? = null + private var exploreRuleV: ExploreRule? = null @Ignore @IgnoredOnParcel - var bookInfoRuleV: BookInfoRule? = null + private var bookInfoRuleV: BookInfoRule? = null @Ignore @IgnoredOnParcel - var tocRuleV: TocRule? = null + private var tocRuleV: TocRule? = null @Ignore @IgnoredOnParcel - var contentRuleV: ContentRule? = null + private var contentRuleV: ContentRule? = null @Throws(Exception::class) fun getHeaderMap(): Map { diff --git a/app/src/main/java/io/legado/app/model/Rss.kt b/app/src/main/java/io/legado/app/model/Rss.kt index d962696eb..c22ac6c45 100644 --- a/app/src/main/java/io/legado/app/model/Rss.kt +++ b/app/src/main/java/io/legado/app/model/Rss.kt @@ -18,7 +18,7 @@ object Rss { ): Coroutine> { return Coroutine.async(scope, context) { val analyzeUrl = AnalyzeUrl(rssSource.sourceUrl) - val body = if (analyzeUrl.useWebView()) { + val body = if (analyzeUrl.useWebView) { analyzeUrl.getResultByWebView(rssSource.sourceUrl) } else { analyzeUrl.getResponseAwait().body() diff --git a/app/src/main/java/io/legado/app/model/WebBook.kt b/app/src/main/java/io/legado/app/model/WebBook.kt index b24865544..89e4cabcc 100644 --- a/app/src/main/java/io/legado/app/model/WebBook.kt +++ b/app/src/main/java/io/legado/app/model/WebBook.kt @@ -97,6 +97,7 @@ class WebBook(val bookSource: BookSource) { headerMapF = bookSource.getHeaderMap() ) if (analyzeUrl.useWebView) { + bookSource.getContentRule() analyzeUrl.getResultByWebView(bookSource.bookSourceUrl) } else { analyzeUrl.getResponseAwait().body()