Skip to content

Commit

Permalink
Fix Imgur albums not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Barillas committed Jan 14, 2019
1 parent 0b6f6ba commit 7400105
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.fernandobarillas.albumparser.imgur.model.AlbumResponse;
import com.fernandobarillas.albumparser.imgur.model.Image;
import com.fernandobarillas.albumparser.imgur.model.ImgurApiError;
import com.fernandobarillas.albumparser.imgur.model.v3.AlbumResponseV3;
import com.fernandobarillas.albumparser.imgur.model.v3.GalleryResponseV3;
import com.fernandobarillas.albumparser.imgur.model.v3.ImageResponseV3;
import com.fernandobarillas.albumparser.media.IMedia;
Expand Down Expand Up @@ -197,14 +198,14 @@ public ParserResponse parse(URL mediaUrl) throws IOException, RuntimeException {
// If response was null, will attempt to run the hash as an album/gallery below
}

Response<GalleryResponseV3> galleryServiceResponse = service.getV3Gallery(clientIdHeader, hash).execute();
GalleryResponseV3 galleryResponse = galleryServiceResponse.body();
if (galleryResponse != null) {
galleryResponse.setLowQuality(mLowQualitySize);
galleryResponse.setPreviewQuality(mPreviewSize);
Response<AlbumResponseV3> albumServiceResponse = service.getV3Album(clientIdHeader, hash).execute();
AlbumResponseV3 albumResponse = albumServiceResponse.body();
if (albumResponse != null) {
albumResponse.setLowQuality(mLowQualitySize);
albumResponse.setPreviewQuality(mPreviewSize);
}

return getParserResponse(mediaUrl, galleryResponse, galleryServiceResponse);
return getParserResponse(mediaUrl, albumResponse, albumServiceResponse);
}

/**
Expand Down

0 comments on commit 7400105

Please sign in to comment.