Skip to content

Commit

Permalink
Fix issue on reading status update
Browse files Browse the repository at this point in the history
  • Loading branch information
prof18 committed Sep 10, 2023
1 parent 65885b5 commit 66c8aa1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,6 @@ internal class DatabaseHelper(
}
.flowOn(backgroundDispatcher)

// @Suppress("MagicNumber")
// fun getFeedItems(): Flow<List<SelectFeeds>> =
// dbRef.feedItemQueries
// .selectFeeds()
// .asFlow()
// .mapToList(backgroundDispatcher)
// .retry(3) { exception ->
// exception is NullPointerException
// }
// .flowOn(backgroundDispatcher)

fun getFeedItems(): List<SelectFeeds> =
dbRef.feedItemQueries
.selectFeeds()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,11 @@ internal class FeedRetrieverRepositoryImpl(

mutableFeedState.update { oldItems ->
(oldItems.toMutableList() + items)
.asSequence()
.filter { !it.isRead }
.distinctBy { it.id }
.sortedByDescending { it.pubDateMillis }
.toList()
}
} catch (e: Throwable) {
logger.e(e) { "Something went wrong, skipping: ${feedSource.url}}" }
Expand Down

0 comments on commit 66c8aa1

Please sign in to comment.