Created
January 24, 2022 15:42
-
-
Save PatrickKalkman/3a353aa9e2bac65d30cd2c21fa395e44 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<ContentValues> parseMedia(JSONArray videoArray) throws JSONException { | |
List<ContentValues> videosToInsert = new ArrayList<>(); | |
for (int j = 0; j < videoArray.length(); j++) { | |
JSONObject video = videoArray.getJSONObject(j); | |
String videoUrl = video.optString(TAG_URL); | |
String titleId = video.optString(TAG_TITLE_ID); | |
if (videoUrl.isEmpty()) { | |
if (!titleId.isEmpty()) { | |
videoUrl = titleId; | |
} else { | |
videoUrl = video.optString("_id"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment