use of org.nzbhydra.news.NewsProvider.NewsEntry in project nzbhydra2 by theotherp.
the class NewsProviderTest method getNewsJson.
protected List<NewsEntry> getNewsJson() throws ParseException, JsonProcessingException {
NewsEntry entry1 = new NewsEntry(new SemanticVersion("1.0.0"), "news1.0.0");
NewsEntry entry2 = new NewsEntry(new SemanticVersion("2.0.0"), "news2.0.0");
NewsEntry entry3 = new NewsEntry(new SemanticVersion("3.0.0"), "news3.0.0");
List<NewsEntry> entries = Arrays.asList(entry2, entry1, entry3);
return entries;
}
use of org.nzbhydra.news.NewsProvider.NewsEntry in project nzbhydra2 by theotherp.
the class NewsWeb method transform.
private List<NewsEntryForWeb> transform(List<NewsEntry> entries) {
List<NewsEntryForWeb> transformedEntries = new ArrayList<>();
for (NewsEntry entry : entries) {
boolean isForCurrentVersion = entry.getShowForVersion().equals(new SemanticVersion(updateManager.getCurrentVersionString()));
boolean isForNewerVersion = entry.getShowForVersion().isUpdateFor(new SemanticVersion(updateManager.getCurrentVersionString()));
transformedEntries.add(new NewsEntryForWeb(entry.getShowForVersion().getAsString(), Markdown.renderMarkdownAsHtml(entry.getNewsAsMarkdown()), isForCurrentVersion, isForNewerVersion));
}
return transformedEntries;
}
Aggregations