mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-22 21:02:16 +03:00
Limit updates to 250 most recent chapters
Still limits to things within the past 3 months though. Closes #9554
This commit is contained in:
parent
f48f212001
commit
4c65c2311e
4 changed files with 8 additions and 9 deletions
|
@ -19,9 +19,9 @@ class UpdatesRepositoryImpl(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun subscribeAll(after: Long): Flow<List<UpdatesWithRelations>> {
|
override fun subscribeAll(after: Long, limit: Long): Flow<List<UpdatesWithRelations>> {
|
||||||
return databaseHandler.subscribeToList {
|
return databaseHandler.subscribeToList {
|
||||||
updatesViewQueries.updates(after, updateWithRelationMapper)
|
updatesViewQueries.getRecentUpdates(after, limit, updateWithRelationMapper)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,11 @@ WHERE favorite = 1
|
||||||
AND date_fetch > date_added
|
AND date_fetch > date_added
|
||||||
ORDER BY date_fetch DESC;
|
ORDER BY date_fetch DESC;
|
||||||
|
|
||||||
updates:
|
getRecentUpdates:
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM updatesView
|
FROM updatesView
|
||||||
WHERE dateUpload > :after;
|
WHERE dateUpload > :after
|
||||||
|
LIMIT :limit;
|
||||||
|
|
||||||
getUpdatesByReadStatus:
|
getUpdatesByReadStatus:
|
||||||
SELECT *
|
SELECT *
|
||||||
|
|
|
@ -13,10 +13,8 @@ class GetUpdates(
|
||||||
return repository.awaitWithRead(read, after)
|
return repository.awaitWithRead(read, after)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun subscribe(calendar: Calendar): Flow<List<UpdatesWithRelations>> = subscribe(calendar.time.time)
|
fun subscribe(calendar: Calendar): Flow<List<UpdatesWithRelations>> {
|
||||||
|
return repository.subscribeAll(calendar.time.time, limit = 250)
|
||||||
fun subscribe(after: Long): Flow<List<UpdatesWithRelations>> {
|
|
||||||
return repository.subscribeAll(after)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun subscribe(read: Boolean, after: Long): Flow<List<UpdatesWithRelations>> {
|
fun subscribe(read: Boolean, after: Long): Flow<List<UpdatesWithRelations>> {
|
||||||
|
|
|
@ -7,7 +7,7 @@ interface UpdatesRepository {
|
||||||
|
|
||||||
suspend fun awaitWithRead(read: Boolean, after: Long): List<UpdatesWithRelations>
|
suspend fun awaitWithRead(read: Boolean, after: Long): List<UpdatesWithRelations>
|
||||||
|
|
||||||
fun subscribeAll(after: Long): Flow<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): Flow<List<UpdatesWithRelations>>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue