File tree 2 files changed +5
-4
lines changed
app/src/main/java/awais/instagrabber
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,10 @@ interface StoriesService {
11
11
suspend fun fetch (@Path(" mediaId" ) mediaId : Long ): String
12
12
13
13
@GET(" /api/v1/feed/reels_tray/" )
14
- suspend fun getFeedStories (): ReelsTrayResponse
14
+ suspend fun getFeedStories (): ReelsTrayResponse ?
15
15
16
16
@GET(" /api/v1/highlights/{uid}/highlights_tray/" )
17
- suspend fun fetchHighlights (@Path(" uid" ) uid : Long ): ReelsTrayResponse
17
+ suspend fun fetchHighlights (@Path(" uid" ) uid : Long ): ReelsTrayResponse ?
18
18
19
19
@GET(" /api/v1/archive/reel/day_shells/" )
20
20
suspend fun fetchArchive (@QueryMap queryParams : Map <String , String >): ArchiveResponse ?
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ open class StoriesRepository(private val service: StoriesService) {
26
26
27
27
suspend fun getFeedStories (): List <Story > {
28
28
val response = service.getFeedStories()
29
- val result = response.tray?.toMutableList() ? : mutableListOf ()
30
- if (response.broadcasts != null ) {
29
+ val result: MutableList < Story > = mutableListOf ()
30
+ if (response? .broadcasts != null ) {
31
31
val length = response.broadcasts.size
32
32
for (i in 0 until length) {
33
33
val broadcast = response.broadcasts.get(i)
@@ -49,6 +49,7 @@ open class StoriesRepository(private val service: StoriesService) {
49
49
)
50
50
}
51
51
}
52
+ if (response?.tray != null ) result.addAll(response.tray)
52
53
return sort(result.toList())
53
54
}
54
55
You can’t perform that action at this time.
0 commit comments