Limit amount of updates loaded for widget

Probably fixes #9868

(cherry picked from commit 87530f506e16db3d5c9ed89740c324ebd464117f)

# Conflicts:
#	domain/src/main/java/tachiyomi/domain/updates/interactor/GetUpdates.kt
This commit is contained in:
arkon
2023-08-27 22:05:52 -04:00
committed by Jobobby04
parent e776d455f5
commit 511979045f
5 changed files with 28 additions and 26 deletions
@@ -17,7 +17,7 @@ class GetUpdates(
suspend fun await(read: Boolean, after: Long): List<UpdatesWithRelations> {
// SY -->
return flow {
emit(repository.awaitWithRead(read, after))
emit(repository.awaitWithRead(read, after, limit = 500))
}
.catchNPE()
.first()
@@ -32,7 +32,7 @@ class GetUpdates(
}
fun subscribe(read: Boolean, after: Long): Flow<List<UpdatesWithRelations>> {
return repository.subscribeWithRead(read, after)
return repository.subscribeWithRead(read, after, limit = 500)
// SY -->
.catchNPE()
// SY <--
@@ -5,9 +5,9 @@ import tachiyomi.domain.updates.model.UpdatesWithRelations
interface UpdatesRepository {
suspend fun awaitWithRead(read: Boolean, after: Long): List<UpdatesWithRelations>
suspend fun awaitWithRead(read: Boolean, after: Long, limit: Long): List<UpdatesWithRelations>
fun subscribeAll(after: Long, limit: Long): Flow<List<UpdatesWithRelations>>
fun subscribeWithRead(read: Boolean, after: Long): Flow<List<UpdatesWithRelations>>
fun subscribeWithRead(read: Boolean, after: Long, limit: Long): Flow<List<UpdatesWithRelations>>
}