pull/37/head
kunfei 5 years ago
parent d312b5be51
commit ad7774a9c0
  1. 2
      app/src/main/java/io/legado/app/data/entities/RssArticle.kt
  2. 6
      app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt

@ -10,7 +10,7 @@ import androidx.room.Ignore
) )
data class RssArticle( data class RssArticle(
var origin: String = "", var origin: String = "",
var title: String? = "", var title: String = "",
var order: Long = 0, var order: Long = 0,
var author: String? = null, var author: String? = null,
var link: String? = null, var link: String? = null,

@ -16,8 +16,10 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application) {
fun initData(intent: Intent) { fun initData(intent: Intent) {
execute { execute {
intent.getStringExtra("guid")?.let { val origin = intent.getStringExtra("origin")
val rssArticle = App.db.rssArtivleDao().get(it) val title = intent.getStringExtra("title")
if (origin != null && title != null) {
val rssArticle = App.db.rssArtivleDao().get(origin, title)
if (rssArticle != null) { if (rssArticle != null) {
if (!rssArticle.description.isNullOrBlank()) { if (!rssArticle.description.isNullOrBlank()) {
contentLiveData.postValue(rssArticle.description) contentLiveData.postValue(rssArticle.description)

Loading…
Cancel
Save