mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-27 12:27:57 +01:00
@@ -9,11 +9,12 @@ class UpdatesRepositoryImpl(
|
||||
private val databaseHandler: DatabaseHandler,
|
||||
) : UpdatesRepository {
|
||||
|
||||
override suspend fun awaitWithRead(read: Boolean, after: Long): List<UpdatesWithRelations> {
|
||||
override suspend fun awaitWithRead(read: Boolean, after: Long, limit: Long): List<UpdatesWithRelations> {
|
||||
return databaseHandler.awaitList {
|
||||
updatesViewQueries.getUpdatesByReadStatus(
|
||||
read = read,
|
||||
after = after,
|
||||
limit = limit,
|
||||
mapper = updateWithRelationMapper,
|
||||
)
|
||||
}
|
||||
@@ -25,11 +26,12 @@ class UpdatesRepositoryImpl(
|
||||
}
|
||||
}
|
||||
|
||||
override fun subscribeWithRead(read: Boolean, after: Long): Flow<List<UpdatesWithRelations>> {
|
||||
override fun subscribeWithRead(read: Boolean, after: Long, limit: Long): Flow<List<UpdatesWithRelations>> {
|
||||
return databaseHandler.subscribeToList {
|
||||
updatesViewQueries.getUpdatesByReadStatus(
|
||||
read = read,
|
||||
after = after,
|
||||
limit = limit,
|
||||
mapper = updateWithRelationMapper,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -30,4 +30,5 @@ getUpdatesByReadStatus:
|
||||
SELECT *
|
||||
FROM updatesView
|
||||
WHERE read = :read
|
||||
AND dateUpload > :after;
|
||||
AND dateUpload > :after
|
||||
LIMIT :limit;
|
||||
Reference in New Issue
Block a user