Browse Source

Fix live stories

renovate/org.robolectric-robolectric-4.x
Ammar Githam 4 years ago
parent
commit
02a1a4a5f5
  1. 4
      app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java
  2. 9
      app/src/main/java/awais/instagrabber/webservices/StoriesService.java

4
app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java

@ -1150,8 +1150,8 @@ public final class ResponseBodyUtils {
data.getString("cover_frame_url"),
MediaItemType.MEDIA_TYPE_LIVE,
data.optLong("published_time", 0),
data.getJSONObject("user").getString("username"),
data.getJSONObject("user").getLong("pk"),
data.getJSONObject("broadcast_owner").getString("username"),
data.getJSONObject("broadcast_owner").getLong("pk"),
false);
model.setVideoUrl(data.getString("dash_playback_url"));
return model;

9
app/src/main/java/awais/instagrabber/webservices/StoriesService.java

@ -205,11 +205,10 @@ public class StoriesService extends BaseService {
);
final String id = node.getString("id");
final long timestamp = node.getLong("published_time");
final JSONObject itemJson = node.has("items") ? node.getJSONArray("items").getJSONObject(0) : null;
StoryModel firstStoryModel = null;
if (itemJson != null) {
firstStoryModel = ResponseBodyUtils.parseBroadcastItem(itemJson);
}
// final JSONObject itemJson = node.has("items") ? node.getJSONArray("items").getJSONObject(0) : null;
final StoryModel firstStoryModel = ResponseBodyUtils.parseBroadcastItem(node);
// if (itemJson != null) {
// }
feedStoryModels.add(new FeedStoryModel(id, user, false, timestamp, firstStoryModel, 1, true, false));
}
callback.onSuccess(sort(feedStoryModels));

Loading…
Cancel
Save