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
|
||||
|
||||
@GET("/api/v1/feed/reels_tray/")
|
||||
suspend fun getFeedStories(): ReelsTrayResponse
|
||||
suspend fun getFeedStories(): ReelsTrayResponse?
|
||||
|
||||
@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/")
|
||||
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> {
|
||||
val response = service.getFeedStories()
|
||||
val result = response.tray?.toMutableList() ?: mutableListOf()
|
||||
if (response.broadcasts != null) {
|
||||
val result: MutableList<Story> = mutableListOf()
|
||||
if (response?.broadcasts != null) {
|
||||
val length = response.broadcasts.size
|
||||
for (i in 0 until length) {
|
||||
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())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue