From a6d2165887c6c96db16c9a67eea07e3f6c01daeb Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 3 Oct 2019 15:33:02 +0800 Subject: [PATCH] up --- .../java/io/legado/app/model/rss/RssParserByRule.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 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 c1609c852..1bd629a50 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 @@ -23,10 +23,9 @@ object RssParserByRule { ) } - val analyzeRule = AnalyzeRule() - analyzeRule.setContent(xml) - rssSource.ruleArticles?.let { ruleArticles -> + val analyzeRule = AnalyzeRule() + analyzeRule.setContent(xml) val collections = analyzeRule.getElements(ruleArticles) val ruleGuid = analyzeRule.splitSourceRule(rssSource.ruleGuid ?: "") val ruleTitle = analyzeRule.splitSourceRule(rssSource.ruleTitle ?: "") @@ -51,7 +50,9 @@ object RssParserByRule { ruleImage, ruleContent, ruleLink - ) + )?.let { + articleList.add(it) + } } } ?: let { return RssParser.parseXML(xml, rssSource.sourceUrl) @@ -84,6 +85,9 @@ object RssParserByRule { rssArticle.image = analyzeRule.getString(ruleImage) rssArticle.content = analyzeRule.getString(ruleContent) rssArticle.link = analyzeRule.getString(ruleLink) + if (rssArticle.title.isNullOrBlank()) { + return null + } return rssArticle } } \ No newline at end of file