Json feed format now works !

This commit is contained in:
Shinokuni 2019-04-29 11:44:02 +02:00
parent aeb4994c2a
commit 49e4b3e12f
3 changed files with 12 additions and 2 deletions

View File

@ -237,11 +237,13 @@ public class Feed implements Parcelable {
feed.setName(jsonFeed.getTitle());
feed.setUrl(jsonFeed.getFeedUrl());
feed.setSiteUrl(jsonFeed.getHomePageUrl());
feed.setDescription(jsonFeed.getDescription());
//feed.setLastUpdated(jsonFeed.); maybe later ?
feed.setEtag(jsonFeed.getEtag());
feed.setLastModified(jsonFeed.getLastModified());
feed.setIconUrl(jsonFeed.getFaviconUrl());
feed.setFolderId(1);

View File

@ -275,7 +275,9 @@ public class Item implements Comparable<Item> {
for (JSONItem item : items) {
Item dbItem = new Item();
dbItem.setAuthor(item.getAuthor().getName());
if (item.getAuthor() != null)
dbItem.setAuthor(item.getAuthor().getName());
dbItem.setContent(item.getContent());
dbItem.setDescription(item.getSummary());
dbItem.setGuid(item.getId());

View File

@ -66,7 +66,13 @@ public abstract class ARepository {
}
protected void setFavIconUtils(Feed feed) throws IOException {
String favUrl = HtmlParser.getFaviconLink(feed.getSiteUrl());
String favUrl;
if (feed.getIconUrl() != null)
favUrl = feed.getIconUrl();
else
favUrl = HtmlParser.getFaviconLink(feed.getSiteUrl());
if (favUrl != null && Patterns.WEB_URL.matcher(favUrl).matches()) {
feed.setIconUrl(favUrl);
setFeedColors(favUrl, feed);