mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 06:37:30 +00:00
some story touch-ups
This commit is contained in:
parent
7ead5046d9
commit
c326356acc
@ -11,10 +11,10 @@ interface StoriesService {
|
|||||||
suspend fun fetch(@Path("mediaId") mediaId: Long): String
|
suspend fun fetch(@Path("mediaId") mediaId: Long): String
|
||||||
|
|
||||||
@GET("/api/v1/feed/reels_tray/")
|
@GET("/api/v1/feed/reels_tray/")
|
||||||
suspend fun getFeedStories(): ReelsTrayResponse
|
suspend fun getFeedStories(): ReelsTrayResponse?
|
||||||
|
|
||||||
@GET("/api/v1/highlights/{uid}/highlights_tray/")
|
@GET("/api/v1/highlights/{uid}/highlights_tray/")
|
||||||
suspend fun fetchHighlights(@Path("uid") uid: Long): ReelsTrayResponse
|
suspend fun fetchHighlights(@Path("uid") uid: Long): ReelsTrayResponse?
|
||||||
|
|
||||||
@GET("/api/v1/archive/reel/day_shells/")
|
@GET("/api/v1/archive/reel/day_shells/")
|
||||||
suspend fun fetchArchive(@QueryMap queryParams: Map<String, String>): ArchiveResponse?
|
suspend fun fetchArchive(@QueryMap queryParams: Map<String, String>): ArchiveResponse?
|
||||||
|
@ -26,8 +26,8 @@ open class StoriesRepository(private val service: StoriesService) {
|
|||||||
|
|
||||||
suspend fun getFeedStories(): List<Story> {
|
suspend fun getFeedStories(): List<Story> {
|
||||||
val response = service.getFeedStories()
|
val response = service.getFeedStories()
|
||||||
val result = response.tray?.toMutableList() ?: mutableListOf()
|
val result: MutableList<Story> = mutableListOf()
|
||||||
if (response.broadcasts != null) {
|
if (response?.broadcasts != null) {
|
||||||
val length = response.broadcasts.size
|
val length = response.broadcasts.size
|
||||||
for (i in 0 until length) {
|
for (i in 0 until length) {
|
||||||
val broadcast = response.broadcasts.get(i)
|
val broadcast = response.broadcasts.get(i)
|
||||||
@ -49,6 +49,7 @@ open class StoriesRepository(private val service: StoriesService) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (response?.tray != null) result.addAll(response.tray)
|
||||||
return sort(result.toList())
|
return sort(result.toList())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user