diff options
author | Cj Malone <Cj-Malone@users.noreply.github.com> | 2016-09-23 13:55:43 +0100 |
---|---|---|
committer | Cj Malone <Cj-Malone@users.noreply.github.com> | 2016-09-23 14:57:00 +0100 |
commit | 68b7431aac8ac62fc437f05cf72472969fe1b69e (patch) | |
tree | 4877050425c268d42c795a6155f803c1afb0724b /core | |
parent | 4a1e728ac519d686f738aa1875802f6221b564c3 (diff) | |
download | AntennaPod-68b7431aac8ac62fc437f05cf72472969fe1b69e.zip |
Use summary tag if content is not available
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java | 8 |
1 files changed, 6 insertions, 2 deletions
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 52b05aa98..ec7ebe1ac 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 @@ -30,6 +30,7 @@ public class NSAtom extends Namespace { private static final String AUTHOR = "author"; private static final String AUTHOR_NAME = "name"; private static final String CONTENT = "content"; + private static final String SUMMARY = "summary"; private static final String IMAGE_LOGO = "logo"; private static final String IMAGE_ICON = "icon"; private static final String SUBTITLE = "subtitle"; @@ -59,8 +60,8 @@ public class NSAtom extends Namespace { /** * Regexp to test whether an Element is a Text Element. */ - private static final String isText = TITLE + "|" + CONTENT + "|" + "|" - + SUBTITLE; + private static final String isText = TITLE + "|" + CONTENT + "|" + + SUBTITLE + "|" + SUMMARY; public static final String isFeed = FEED + "|" + NSRSS20.CHANNEL; public static final String isFeedItem = ENTRY + "|" + NSRSS20.ITEM; @@ -191,6 +192,9 @@ public class NSAtom extends Namespace { } else if (CONTENT.equals(top) && ENTRY.equals(second) && textElement != null && state.getCurrentItem() != null) { state.getCurrentItem().setDescription(textElement.getProcessedContent()); + } else if (SUMMARY.equals(top) && ENTRY.equals(second) && textElement != null && + state.getCurrentItem() != null && state.getCurrentItem().getDescription() == null) { + state.getCurrentItem().setDescription(textElement.getProcessedContent()); } else if (UPDATED.equals(top) && ENTRY.equals(second) && state.getCurrentItem() != null && state.getCurrentItem().getPubDate() == null) { state.getCurrentItem().setPubDate(DateUtils.parse(content)); |