|
|
@ -54,18 +54,21 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
|
|
|
|
|
|
|
|
private fun loadContent(rssArticle: RssArticle, ruleContent: String) { |
|
|
|
private fun loadContent(rssArticle: RssArticle, ruleContent: String) { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
AnalyzeUrl(rssArticle.link, baseUrl = rssArticle.origin).getResponseAwait().body() |
|
|
|
val analyzeUrl = AnalyzeUrl(rssArticle.link, baseUrl = rssArticle.origin) |
|
|
|
?.let { body -> |
|
|
|
val content = if (analyzeUrl.useWebView) { |
|
|
|
AnalyzeRule().apply { |
|
|
|
analyzeUrl.getResultByWebView(rssArticle.origin).content |
|
|
|
setContent( |
|
|
|
} else analyzeUrl.getResponseAwait().body() |
|
|
|
body, |
|
|
|
content?.let { body -> |
|
|
|
NetworkUtils.getAbsoluteURL(rssArticle.origin, rssArticle.link) |
|
|
|
AnalyzeRule().apply { |
|
|
|
) |
|
|
|
setContent( |
|
|
|
getString(ruleContent).let { content -> |
|
|
|
body, |
|
|
|
contentLiveData.postValue(content) |
|
|
|
NetworkUtils.getAbsoluteURL(rssArticle.origin, rssArticle.link) |
|
|
|
} |
|
|
|
) |
|
|
|
|
|
|
|
getString(ruleContent).let { content -> |
|
|
|
|
|
|
|
contentLiveData.postValue(content) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|