From 68b7431aac8ac62fc437f05cf72472969fe1b69e Mon Sep 17 00:00:00 2001 From: Cj Malone Date: Fri, 23 Sep 2016 13:55:43 +0100 Subject: [PATCH] Use summary tag if content is not available --- .../core/syndication/namespace/atom/NSAtom.java | 8 ++++++-- 1 file 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));