mirror of https://github.com/readrops/Readrops.git
Fix getting sinceId after last items call in FeverDataSource
This commit is contained in:
parent
7b3920374e
commit
dd98c7b0a6
|
@ -82,7 +82,7 @@ class FeverDataSource(private val service: FeverService) {
|
|||
}
|
||||
|
||||
sinceId = if (items.isNotEmpty()) {
|
||||
items.first().remoteId!!.toLong()
|
||||
items.maxOfOrNull { it.remoteId!!.toLong() }!!
|
||||
} else {
|
||||
localSinceId.toLong()
|
||||
}
|
||||
|
|
|
@ -157,6 +157,7 @@ class FeverDataSourceTest : KoinTest {
|
|||
assertEquals(6, result.starredIds.size)
|
||||
assertEquals(10, result.items.size)
|
||||
assertEquals(10, result.items.size)
|
||||
assertEquals(1564058340320135, result.sinceId)
|
||||
|
||||
assertEquals("1564058340320135", firstMaxId)
|
||||
assertEquals("6", secondMaxId)
|
||||
|
@ -229,6 +230,7 @@ class FeverDataSourceTest : KoinTest {
|
|||
assertEquals(6, result.unreadIds.size)
|
||||
assertEquals(6, result.starredIds.size)
|
||||
assertEquals(10, result.items.size)
|
||||
assertEquals(10, result.sinceId)
|
||||
|
||||
assertEquals("1", firstLastSinceId)
|
||||
assertEquals("5", secondLastSinceId)
|
||||
|
|
Loading…
Reference in New Issue