1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-26 08:37:29 +00:00

not all videos have audios

This commit is contained in:
Austin Huang 2020-08-03 22:57:47 -04:00
parent fc1891fbbf
commit 8421b498bb
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
2 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ public final class iStoryStatusFetcher extends AsyncTask<Void, Void, StoryModel[
final StoryModel[] models = new StoryModel[mediaLen]; final StoryModel[] models = new StoryModel[mediaLen];
for (int i = 0; i < mediaLen; ++i) { for (int i = 0; i < mediaLen; ++i) {
data = media.getJSONObject(i); data = media.getJSONObject(i);
final boolean isVideo = data.has("has_audio") && data.optBoolean("has_audio"); final boolean isVideo = data.has("video_duration");
models[i] = new StoryModel(data.getString("pk"), models[i] = new StoryModel(data.getString("pk"),
data.getJSONObject("image_versions2").getJSONArray("candidates").getJSONObject(0).getString("url"), data.getJSONObject("image_versions2").getJSONArray("candidates").getJSONObject(0).getString("url"),

View File

@ -1257,7 +1257,7 @@ public final class Utils {
final StoryModel[] storyModels = new StoryModel[itemsLen]; final StoryModel[] storyModels = new StoryModel[itemsLen];
for (int j = 0; j < itemsLen; ++j) { for (int j = 0; j < itemsLen; ++j) {
final JSONObject data = items.getJSONObject(j); final JSONObject data = items.getJSONObject(j);
final boolean isVideo = data.has("has_audio") && data.optBoolean("has_audio"); final boolean isVideo = data.has("video_duration");
storyModels[j] = new StoryModel(data.getString("pk"), storyModels[j] = new StoryModel(data.getString("pk"),
data.getJSONObject("image_versions2").getJSONArray("candidates").getJSONObject(0).getString("url"), data.getJSONObject("image_versions2").getJSONArray("candidates").getJSONObject(0).getString("url"),