Skip to content

Commit

Permalink
♻️ refactor code for better readability #23
Browse files Browse the repository at this point in the history
  • Loading branch information
McPringle committed Dec 2, 2024
1 parent 47de61a commit 76c8885
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@ private Post createPost(final @NotNull JSONObject post) {
final var imageLinks = new ArrayList<String>();
if (post.has("embed")) {
final var embed = post.getJSONObject("embed");
if (embed.getString("$type").equals("app.bsky.embed.images#view")) {
final var type = embed.getString("$type");
if (type.equals("app.bsky.embed.images#view")) {
final var images = embed.getJSONArray("images");
for (var i = 0; i < images.length(); i++) {
imageLinks.add(images.getJSONObject(i).getString("thumb"));
final var image = images.getJSONObject(i);
imageLinks.add(image.getString("thumb"));
}
}
}
Expand Down

0 comments on commit 76c8885

Please sign in to comment.