diff --git a/app/src/main/java/io/legado/app/data/dao/RssArticleDao.kt b/app/src/main/java/io/legado/app/data/dao/RssArticleDao.kt index fdcd309c8..44c333ac7 100644 --- a/app/src/main/java/io/legado/app/data/dao/RssArticleDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/RssArticleDao.kt @@ -7,10 +7,10 @@ import io.legado.app.data.entities.RssArticle @Dao interface RssArticleDao { - @Query("select * from rssArticles where guid = :key") - fun get(key: String): RssArticle? + @Query("select * from rssArticles where origin = :origin and title = :title") + fun get(origin: String, title: String): RssArticle? - @Query("select * from rssArticles where origin = :origin order by time desc") + @Query("select * from rssArticles where origin = :origin order by `order` desc") fun liveByOrigin(origin: String): LiveData> @Insert(onConflict = OnConflictStrategy.IGNORE) diff --git a/app/src/main/java/io/legado/app/data/entities/RssArticle.kt b/app/src/main/java/io/legado/app/data/entities/RssArticle.kt index ffb91892f..b3c664fcd 100644 --- a/app/src/main/java/io/legado/app/data/entities/RssArticle.kt +++ b/app/src/main/java/io/legado/app/data/entities/RssArticle.kt @@ -11,7 +11,7 @@ import androidx.room.Ignore data class RssArticle( var origin: String = "", var title: String? = null, - var time: Long = System.currentTimeMillis(), + var order: Long = 0, var author: String? = null, var link: String? = null, var pubDate: String? = null,