add releases to extensionstore item detail view

This commit is contained in:
sirjonasxx 2022-02-10 17:44:25 +01:00
parent da8454e92a
commit 129cff8c37
3 changed files with 16 additions and 5 deletions

View File

@ -49,8 +49,12 @@ public class StoreExtensionDetailsItem implements ContentItem {
.append("*Author(s):* ").append(storeExtension.getAuthors().stream().map(StoreExtension.Author::getName).collect(Collectors.joining(", "))).append("\n\n") .append("*Author(s):* ").append(storeExtension.getAuthors().stream().map(StoreExtension.Author::getName).collect(Collectors.joining(", "))).append("\n\n")
.append("*Categories:* ").append(storeExtension.getCategories().stream().map(ExtCategory::getName).collect(Collectors.joining(", "))).append("\n\n"); .append("*Categories:* ").append(storeExtension.getCategories().stream().map(ExtCategory::getName).collect(Collectors.joining(", "))).append("\n\n");
contentBuilder.append("*Technical information*").append("\n") contentBuilder.append("*Technical information*").append("\n");
.append("> Language: ").append(storeExtension.getLanguage()).append("\n")
if(storeExtension.getReleases() != null)
contentBuilder.append("> Releases: --url:Click Here-").append(storeExtension.getReleases()).append("\n");
contentBuilder.append("> Language: ").append(storeExtension.getLanguage()).append("\n")
.append("> Source: --url:Click Here-").append(storeExtension.getSource()).append("\n") .append("> Source: --url:Click Here-").append(storeExtension.getSource()).append("\n")
.append("> Framework: ").append(storeExtension.getFramework().getFramework().getName()).append(" - v").append(storeExtension.getFramework().getVersion()).append("\n") .append("> Framework: ").append(storeExtension.getFramework().getFramework().getName()).append(" - v").append(storeExtension.getFramework().getVersion()).append("\n")
.append("> Systems: ").append(String.join(", ", storeExtension.getCompatibility().getSystems())).append("\n \n"); .append("> Systems: ").append(String.join(", ", storeExtension.getCompatibility().getSystems())).append("\n \n");

View File

@ -34,11 +34,11 @@ public class StoreFetch {
new URL(String.format("https://raw.githubusercontent.com/%s/repo/%s/store/config.json", source, version)) new URL(String.format("https://raw.githubusercontent.com/%s/repo/%s/store/config.json", source, version))
.openStream(), StandardCharsets.UTF_8)); .openStream(), StandardCharsets.UTF_8));
JSONArray exensions = new JSONArray(IOUtils.toString( JSONArray extensions = new JSONArray(IOUtils.toString(
new URL(String.format("https://raw.githubusercontent.com/%s/repo/%s/.auto-generated/extensions.json", source, version)) new URL(String.format("https://raw.githubusercontent.com/%s/repo/%s/.auto-generated/extensions.json", source, version))
.openStream(), StandardCharsets.UTF_8)); .openStream(), StandardCharsets.UTF_8));
storeFetchListener.success(new StoreRepository(new StoreData(config, exensions), version, source)); storeFetchListener.success(new StoreRepository(new StoreData(config, extensions), version, source));
} catch (Exception e) { } catch (Exception e) {
storeFetchListener.fail(e.getLocalizedMessage()); storeFetchListener.fail(e.getLocalizedMessage());

View File

@ -10,7 +10,7 @@ import java.util.stream.Collectors;
public class StoreExtension { public class StoreExtension {
public StoreExtension(String title, String description, List<Author> authors, String version, List<ExtCategory> categories, String source, String readme, boolean stable, Framework framework, String language, Commands commands, Compatibility compatibility, LocalDateTime submissionDate, LocalDateTime updateDate, boolean isOutdated, int rating) { public StoreExtension(String title, String description, List<Author> authors, String version, List<ExtCategory> categories, String source, String readme, String releases, boolean stable, Framework framework, String language, Commands commands, Compatibility compatibility, LocalDateTime submissionDate, LocalDateTime updateDate, boolean isOutdated, int rating) {
this.title = title; this.title = title;
this.description = description; this.description = description;
this.authors = authors; this.authors = authors;
@ -18,6 +18,7 @@ public class StoreExtension {
this.categories = categories; this.categories = categories;
this.source = source; this.source = source;
this.readme = readme; this.readme = readme;
this.releases = releases;
this.stable = stable; this.stable = stable;
this.framework = framework; this.framework = framework;
this.language = language; this.language = language;
@ -38,6 +39,7 @@ public class StoreExtension {
.toList().stream().anyMatch(j -> j.equals(c.getName()))).collect(Collectors.toList()); .toList().stream().anyMatch(j -> j.equals(c.getName()))).collect(Collectors.toList());
this.source = object.getString("source"); this.source = object.getString("source");
this.readme = object.has("readme") ? object.getString("readme") : null; this.readme = object.has("readme") ? object.getString("readme") : null;
this.releases = object.has("releases") ? object.getString("releases") : null;
this.stable = object.getBoolean("stable"); this.stable = object.getBoolean("stable");
this.framework = new Framework(object.getJSONObject("framework"), storeConfig); this.framework = new Framework(object.getJSONObject("framework"), storeConfig);
this.language = object.getString("language"); this.language = object.getString("language");
@ -201,6 +203,7 @@ public class StoreExtension {
private final String source; private final String source;
private final String readme; private final String readme;
private final String releases;
private final boolean stable; private final boolean stable;
@ -246,6 +249,10 @@ public class StoreExtension {
return readme; return readme;
} }
public String getReleases() {
return releases;
}
public boolean isStable() { public boolean isStable() {
return stable; return stable;
} }