--- a/app/src/main/java/com/geekorum/ttrss/data/ArticleDao.kt Wed Jun 25 11:29:29 2025 -0400
+++ b/app/src/main/java/com/geekorum/ttrss/data/ArticleDao.kt Wed Jun 25 11:31:07 2025 -0400
@@ -56,6 +56,10 @@
@Transaction
suspend fun getUnreadArticlesRandomized(count: Int): List<ArticleWithFeed>
+ @Query("SELECT * FROM articles WHERE unread=1 LIMIT :count")
+ @Transaction
+ suspend fun getUnreadArticles(count: Int): List<ArticleWithFeed>
+
@Query("SELECT * FROM articles WHERE feed_id=:feedId ORDER BY last_time_update DESC ")
@Transaction
fun getAllArticlesForFeed(feedId: Long): PagingSource<Int, ArticleWithFeed>
@@ -75,6 +79,10 @@
@Transaction
suspend fun getAllUnreadArticlesForFeedUpdatedAfterTimeRandomized(feedId: Long, time: Long): List<Article>
+ @Query("SELECT * FROM articles WHERE last_time_update>=:time AND unread=1 AND feed_id=:feedId ")
+ @Transaction
+ suspend fun getAllUnreadArticlesForFeedUpdatedAfterTime(feedId: Long, time: Long): List<Article>
+
@Query("SELECT articles.* FROM articles " +
" JOIN articles_tags ON (articles_tags.article_id = articles._id)" +
" WHERE articles_tags.tag=:tag ORDER BY last_time_update DESC")