Skip to content

Commit

Permalink
Merge pull request #130 from elimu-ai/129-download-images-from-extern…
Browse files Browse the repository at this point in the history
…al-platform

fix: download url
  • Loading branch information
jo-elimu authored Dec 3, 2024
2 parents 9724b9c + 9358666 commit ddf5a2c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ public void run() {
if (!imageFile.exists()) {
// Download file bytes
BaseApplication baseApplication = (BaseApplication) getActivity().getApplication();
String downloadUrl = baseApplication.getBaseUrl() + imageGson.getBytesUrl();
String downloadUrl = imageGson.getBytesUrl().startsWith("http")
? imageGson.getBytesUrl()
: baseApplication.getBaseUrl() + imageGson.getBytesUrl();
Log.i(getClass().getName(), "downloadUrl: " + downloadUrl);
byte[] bytes = MultimediaDownloader.downloadFileBytes(downloadUrl);
Log.i(getClass().getName(), "bytes.length: " + bytes.length);
Expand Down

0 comments on commit ddf5a2c

Please sign in to comment.