Fix live stories

This commit is contained in:
Ammar Githam 2021-01-13 22:21:20 +09:00
parent 4b055c8050
commit 02a1a4a5f5
2 changed files with 6 additions and 7 deletions

View File

@ -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;

View File

@ -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));