From 0feab3459e55b4ec53825bfd02f52862ad3b35de Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 8 Oct 2019 13:50:57 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/data/dao/RssArticleDao.kt | 6 +++--- app/src/main/java/io/legado/app/data/entities/RssArticle.kt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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,