Skip to content

Commit

Permalink
properly fixed issue where only to ptwo images could be pulled
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowbluesky committed Apr 30, 2019
1 parent f9fa240 commit 73e87f3
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ protected void onLoadRequested(boolean initial)
do
{
pictureMetadata = overallJson.getJSONArray("contents")
.getJSONObject(random.nextInt(50));
.getJSONObject(random.nextInt(overallJson.getJSONArray("contents").length()));
} while (pictureMetadata.getInt("illust_type") != 0);
Log.d(LOG_TAG, "ranking");
title = pictureMetadata.getString("title");
Expand All @@ -329,9 +329,8 @@ protected void onLoadRequested(boolean initial)
else
{
Log.d(LOG_TAG, "feed or bookmark");
Log.d(LOG_TAG,overallJson.toString());
pictureMetadata = overallJson.getJSONArray("illusts")
.getJSONObject(random.nextInt(30));
.getJSONObject(random.nextInt(overallJson.getJSONArray("illusts").length()));
title = pictureMetadata.getString("title");
byline = pictureMetadata.getJSONObject("user").getString("name");
token = pictureMetadata.getString("id");
Expand Down

0 comments on commit 73e87f3

Please sign in to comment.