From f32710001c8be3ccba130e41e2f70d787bceb361 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 11 Mar 2022 09:08:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/model/rss/RssParserByRule.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/rss/RssParserByRule.kt b/app/src/main/java/io/legado/app/model/rss/RssParserByRule.kt index c95541081..fb5e578b6 100644 --- a/app/src/main/java/io/legado/app/model/rss/RssParserByRule.kt +++ b/app/src/main/java/io/legado/app/model/rss/RssParserByRule.kt @@ -7,7 +7,7 @@ import io.legado.app.data.entities.RssSource import io.legado.app.model.Debug import io.legado.app.model.NoStackTraceException import io.legado.app.model.analyzeRule.AnalyzeRule -import io.legado.app.model.analyzeRule.RuleDataInterface +import io.legado.app.model.analyzeRule.RuleData import io.legado.app.utils.NetworkUtils import splitties.init.appCtx import java.util.* @@ -21,7 +21,7 @@ object RssParserByRule { sortUrl: String, body: String?, rssSource: RssSource, - ruleData: RuleDataInterface + ruleData: RuleData ): Pair, String?> { val sourceUrl = rssSource.sourceUrl var nextUrl: String? = null @@ -66,9 +66,10 @@ object RssParserByRule { val ruleDescription = analyzeRule.splitSourceRule(rssSource.ruleDescription) val ruleImage = analyzeRule.splitSourceRule(rssSource.ruleImage) val ruleLink = analyzeRule.splitSourceRule(rssSource.ruleLink) + val variable = ruleData.getVariable() for ((index, item) in collections.withIndex()) { getItem( - sourceUrl, item, analyzeRule, ruleData, index == 0, + sourceUrl, item, analyzeRule, variable, index == 0, ruleTitle, rulePubDate, ruleDescription, ruleImage, ruleLink )?.let { it.sort = sortName @@ -87,7 +88,7 @@ object RssParserByRule { sourceUrl: String, item: Any, analyzeRule: AnalyzeRule, - ruleData: RuleDataInterface, + variable: String?, log: Boolean, ruleTitle: List, rulePubDate: List, @@ -95,7 +96,7 @@ object RssParserByRule { ruleImage: List, ruleLink: List ): RssArticle? { - val rssArticle = RssArticle(variable = ruleData.variable) + val rssArticle = RssArticle(variable = variable) analyzeRule.ruleData = rssArticle analyzeRule.setContent(item) Debug.log(sourceUrl, "┌获取标题", log)