1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-22 22:57:29 +00:00

Fix no vc_id in VIDEO_CALL_EVENT

This commit is contained in:
Ammar Githam 2020-11-30 18:57:23 +09:00
parent d1a9393249
commit 3dfbf23cc0

View File

@ -453,7 +453,7 @@ public final class ResponseBodyUtils {
case VIDEO_CALL_EVENT: { case VIDEO_CALL_EVENT: {
final JSONObject videoCallEvent = itemObject.getJSONObject("video_call_event"); final JSONObject videoCallEvent = itemObject.getJSONObject("video_call_event");
videoCallEventModel = new DirectItemModel.DirectItemVideoCallEventModel(videoCallEvent.getLong("vc_id"), videoCallEventModel = new DirectItemModel.DirectItemVideoCallEventModel(videoCallEvent.optLong("vc_id"),
videoCallEvent.optBoolean("thread_has_audio_only_call"), videoCallEvent.optBoolean("thread_has_audio_only_call"),
videoCallEvent.getString("action"), videoCallEvent.getString("action"),
videoCallEvent.getString("description")); videoCallEvent.getString("description"));
@ -743,13 +743,13 @@ public final class ResponseBodyUtils {
String thumbnailUrl = null; String thumbnailUrl = null;
try { try {
thumbnailUrl = feedItem.getJSONArray("display_resources") thumbnailUrl = feedItem.getJSONArray("display_resources")
.getJSONObject(0) .getJSONObject(0)
.getString("src"); .getString("src");
} catch (JSONException ignored) {} } catch (JSONException ignored) {}
final FeedModel.Builder feedModelBuilder = new FeedModel.Builder() final FeedModel.Builder feedModelBuilder = new FeedModel.Builder()
.setProfileModel(profileModel) .setProfileModel(profileModel)
.setItemType(isVideo ? MediaItemType.MEDIA_TYPE_VIDEO .setItemType(isVideo ? MediaItemType.MEDIA_TYPE_VIDEO
: MediaItemType.MEDIA_TYPE_IMAGE) : MediaItemType.MEDIA_TYPE_IMAGE)
.setViewCount(videoViews) .setViewCount(videoViews)
.setPostId(feedItem.getString(Constants.EXTRAS_ID)) .setPostId(feedItem.getString(Constants.EXTRAS_ID))
.setDisplayUrl(resourceUrl) .setDisplayUrl(resourceUrl)
@ -843,17 +843,17 @@ public final class ResponseBodyUtils {
String thumbnailUrl = null; String thumbnailUrl = null;
try { try {
thumbnailUrl = childNode.getJSONArray("display_resources") thumbnailUrl = childNode.getJSONArray("display_resources")
.getJSONObject(0) .getJSONObject(0)
.getString("src"); .getString("src");
} catch (JSONException ignored) {} } catch (JSONException ignored) {}
final PostChild sliderItem = new PostChild.Builder() final PostChild sliderItem = new PostChild.Builder()
.setItemType(isChildVideo ? MediaItemType.MEDIA_TYPE_VIDEO .setItemType(isChildVideo ? MediaItemType.MEDIA_TYPE_VIDEO
: MediaItemType.MEDIA_TYPE_IMAGE) : MediaItemType.MEDIA_TYPE_IMAGE)
.setPostId(childNode.getString(Constants.EXTRAS_ID)) .setPostId(childNode.getString(Constants.EXTRAS_ID))
.setDisplayUrl(isChildVideo ? childNode.getString("video_url") .setDisplayUrl(isChildVideo ? childNode.getString("video_url")
: childNode.getString("display_url")) : childNode.getString("display_url"))
.setThumbnailUrl(thumbnailUrl != null ? thumbnailUrl .setThumbnailUrl(thumbnailUrl != null ? thumbnailUrl
: childNode.getString("display_url")) : childNode.getString("display_url"))
.setVideoViews(childNode.optLong("video_view_count", 0)) .setVideoViews(childNode.optLong("video_view_count", 0))
.setHeight(height) .setHeight(height)
.setWidth(width) .setWidth(width)