diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2016-07-23 10:07:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-23 10:07:58 +0200 |
commit | e4bd99e05972300035ae2f3a2c29df0997ef48fa (patch) | |
tree | 2ce59e9098c9c9961fcb7d85df0692ceee87a6a2 /core/src | |
parent | ef31878a1004194d1b258a0727fa459d8a101c15 (diff) | |
parent | 96468f0e8588e3b4804cb7a66ae2097763b9470d (diff) | |
download | AntennaPod-e4bd99e05972300035ae2f3a2c29df0997ef48fa.zip |
Merge pull request #2073 from Cj-Malone/develop
Improve Atom support
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java | 6 | ||||
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java | 13 |
2 files changed, 16 insertions, 3 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java index a086d6632..ee0a71f30 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java @@ -45,6 +45,12 @@ public class TypeGetter { case ATOM_ROOT: feed.setType(Feed.TYPE_ATOM1); Log.d(TAG, "Recognized type Atom"); + + String strLang = xpp.getAttributeValue("http://www.w3.org/XML/1998/namespace", "lang"); + if (strLang != null) { + feed.setLanguage(strLang); + } + return Type.ATOM; case RSS_ROOT: String strVersion = xpp.getAttributeValue(null, "version"); diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java index 7b5abf053..52b05aa98 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java @@ -28,8 +28,10 @@ public class NSAtom extends Namespace { private static final String LINK = "link"; private static final String UPDATED = "updated"; private static final String AUTHOR = "author"; + private static final String AUTHOR_NAME = "name"; 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 PUBLISHED = "published"; @@ -194,10 +196,15 @@ public class NSAtom extends Namespace { state.getCurrentItem().setPubDate(DateUtils.parse(content)); } else if (PUBLISHED.equals(top) && ENTRY.equals(second) && state.getCurrentItem() != null) { 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)); + } else if (AUTHOR.equals(second) && state.getFeed() != null) { + if (AUTHOR_NAME.equals(top)) { + state.getFeed().setAuthor(content); + } } } } - } |