mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-10 21:31:53 +01:00
Add image_link field to community marketplace invididual add-ons (#2521)
When I ported over the code from the HABPanel gallery which was also
based on Discourse topics, the image_link field that was present on
topic lists wasn't replicated on single topic entries, but now it is:
See
https://meta.discourse.org/t/single-topic-api-endpoint-should-contain-image-url/131020
3201613f13
I have confirmed the field is present on community.openhab.org.
So this should help moving the "primary image" to the place where
the logo should be in the UI.
We can prevent the same image from being displayed twice with some
measures on the Discourse posts themselves
(like have it between <details></details>).
Signed-off-by: Yannick Schaus <github@schaus.net>
This commit is contained in:
parent
cffdcd04b3
commit
9d9dc70d89
@ -434,7 +434,7 @@ public class CommunityMarketplaceAddonService implements AddonService {
|
||||
.anyMatch(handler -> handler.supports(type, contentType) && handler.isInstalled(id));
|
||||
|
||||
return Addon.create(id).withType(type).withContentType(contentType).withLabel(topic.title)
|
||||
.withLink(COMMUNITY_TOPIC_URL + topic.id.toString())
|
||||
.withImageLink(topic.image_url).withLink(COMMUNITY_TOPIC_URL + topic.id.toString())
|
||||
.withAuthor(topic.post_stream.posts[0].display_username).withMaturity(maturity)
|
||||
.withDetailedDescription(detailedDescription).withInstalled(installed).withProperties(properties)
|
||||
.build();
|
||||
|
@ -27,6 +27,7 @@ public class DiscourseTopicResponseDTO {
|
||||
|
||||
public String title;
|
||||
public Integer posts_count;
|
||||
public String image_url;
|
||||
|
||||
public Date created_at;
|
||||
public Date updated_at;
|
||||
|
Loading…
Reference in New Issue
Block a user