skip empty preview card
This commit is contained in:
@@ -20,7 +20,7 @@ public class FediMedium implements Serializable {
|
|||||||
this.mediumType = IMAGE;
|
this.mediumType = IMAGE;
|
||||||
this.description = "missing alt text";
|
this.description = "missing alt text";
|
||||||
this.mediumUrl = "unknown";
|
this.mediumUrl = "unknown";
|
||||||
this.mediumImage = "assets/splash.jpg";
|
this.mediumImage = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMediumType() {
|
public String getMediumType() {
|
||||||
|
|||||||
@@ -80,12 +80,9 @@ public class JSONLoader implements Serializable {
|
|||||||
if (imageObject != null && imageObject instanceof String) {
|
if (imageObject != null && imageObject instanceof String) {
|
||||||
medium.setMediumImage(jsonCard.getString("image"));
|
medium.setMediumImage(jsonCard.getString("image"));
|
||||||
medium.setMediumImage(buildCacheUrl(jsonCard.getString("image")));
|
medium.setMediumImage(buildCacheUrl(jsonCard.getString("image")));
|
||||||
} else {
|
|
||||||
final String defaultImage = contextUrl + medium.getMediumImage();
|
|
||||||
medium.setMediumImage(defaultImage);
|
|
||||||
}
|
|
||||||
post.addFediMedium(medium);
|
post.addFediMedium(medium);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int mediaIdx=0; mediaIdx<mediaJsonArray.length(); mediaIdx++) {
|
for (int mediaIdx=0; mediaIdx<mediaJsonArray.length(); mediaIdx++) {
|
||||||
final JSONObject mediumJsonObject = mediaJsonArray.getJSONObject(mediaIdx);
|
final JSONObject mediumJsonObject = mediaJsonArray.getJSONObject(mediaIdx);
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 58 KiB |
Reference in New Issue
Block a user