mirror of https://github.com/readrops/Readrops.git
Fever: do not trust provider ordering and always check for the max instead of the first element
This commit is contained in:
parent
345c4a2bd7
commit
cbc9d8b3c2
|
@ -41,7 +41,7 @@ class FeverDataSource(private val service: FeverService) {
|
||||||
.reversed()
|
.reversed()
|
||||||
.take(MAX_ITEMS_IDS)
|
.take(MAX_ITEMS_IDS)
|
||||||
|
|
||||||
var maxId = unreadIds.first()
|
var maxId = unreadIds.maxOfOrNull { it }
|
||||||
items = buildList {
|
items = buildList {
|
||||||
for (index in 0 until INITIAL_SYNC_ITEMS_REQUESTS_COUNT) {
|
for (index in 0 until INITIAL_SYNC_ITEMS_REQUESTS_COUNT) {
|
||||||
val newItems = service.getItems(body, maxId, null)
|
val newItems = service.getItems(body, maxId, null)
|
||||||
|
@ -53,7 +53,7 @@ class FeverDataSource(private val service: FeverService) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sinceId = unreadIds.first().toLong()
|
sinceId = unreadIds.maxOfOrNull { it.toLong() } ?: 0
|
||||||
},
|
},
|
||||||
async { starredIds = service.getStarredItemsIds(body) },
|
async { starredIds = service.getStarredItemsIds(body) },
|
||||||
async { favicons = service.getFavicons(body) }
|
async { favicons = service.getFavicons(body) }
|
||||||
|
|
Loading…
Reference in New Issue