From 2f464549b059ea4767036e4f7cf91ccb108be687 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 3 Feb 2021 17:09:29 +0100 Subject: [PATCH] Clean up code --- .../osmand/plus/openplacereviews/IPFSImageCard.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/openplacereviews/IPFSImageCard.java b/OsmAnd/src/net/osmand/plus/openplacereviews/IPFSImageCard.java index e1ba5d2e0c..d19dcb7fab 100644 --- a/OsmAnd/src/net/osmand/plus/openplacereviews/IPFSImageCard.java +++ b/OsmAnd/src/net/osmand/plus/openplacereviews/IPFSImageCard.java @@ -20,16 +20,17 @@ public class IPFSImageCard extends ImageCard { public IPFSImageCard(MapActivity mapActivity, JSONObject imageObject) { super(mapActivity, imageObject); - url = mapActivity.getString(R.string.opr_base_url) + "api/ipfs/image?"; try { - url += "cid=" + (String) imageObject.getString("cid"); - url += "&hash=" + (String) imageObject.getString("hash"); - url += "&ext=" + (String) imageObject.getString("extension"); + String calcImageUrl = mapActivity.getString(R.string.opr_base_url) + "api/ipfs/image?"; + calcImageUrl += "cid=" + (String) imageObject.getString("cid"); + calcImageUrl += "&hash=" + (String) imageObject.getString("hash"); + calcImageUrl += "&ext=" + (String) imageObject.getString("extension"); + url = calcImageUrl; + imageHiresUrl = url; + imageUrl = url; } catch (JSONException e) { LOG.error(e); } - imageHiresUrl = url; - imageUrl = url; icon = ContextCompat.getDrawable(getMyApplication(), R.drawable.ic_logo_openplacereview); if (!Algorithms.isEmpty(getUrl())) { View.OnClickListener onClickListener = new View.OnClickListener() {