Fixes Atom icon image

Falls back to logo if it is present but icon isn't.
https://github.com/AntennaPod/AntennaPod/issues/1949
This commit is contained in:
Cj Malone 2016-07-20 11:34:48 +01:00
parent 44b37fc043
commit baf1569020
1 changed files with 5 additions and 3 deletions

View File

@ -29,7 +29,8 @@ public class NSAtom extends Namespace {
private static final String UPDATED = "updated"; private static final String UPDATED = "updated";
private static final String AUTHOR = "author"; private static final String AUTHOR = "author";
private static final String CONTENT = "content"; private static final String CONTENT = "content";
private static final String IMAGE = "logo"; private static final String IMAGE_LOGO = "logo";
private static final String IMAGE_ICON = "icon";
private static final String SUBTITLE = "subtitle"; private static final String SUBTITLE = "subtitle";
private static final String PUBLISHED = "published"; private static final String PUBLISHED = "published";
@ -194,10 +195,11 @@ public class NSAtom extends Namespace {
state.getCurrentItem().setPubDate(DateUtils.parse(content)); state.getCurrentItem().setPubDate(DateUtils.parse(content));
} else if (PUBLISHED.equals(top) && ENTRY.equals(second) && state.getCurrentItem() != null) { } else if (PUBLISHED.equals(top) && ENTRY.equals(second) && state.getCurrentItem() != null) {
state.getCurrentItem().setPubDate(DateUtils.parse(content)); state.getCurrentItem().setPubDate(DateUtils.parse(content));
} else if (IMAGE.equals(top) && state.getFeed() != null && state.getFeed().getImage() == null) { } else if (IMAGE_LOGO.equals(top) && state.getFeed() != null && state.getFeed().getImage() == null) {
state.getFeed().setImage(new FeedImage(state.getFeed(), content, null));
} else if (IMAGE_ICON.equals(top) && state.getFeed() != null) {
state.getFeed().setImage(new FeedImage(state.getFeed(), content, null)); state.getFeed().setImage(new FeedImage(state.getFeed(), content, null));
} }
} }
} }
} }