summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2014-05-25 16:45:54 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2014-05-25 16:45:54 +0200
commit8a2332f8533d90fd03f58dbe4cf8143b1aa989d7 (patch)
treecbc37dbd3b472d2897396b926c27ad410715ac40 /src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java
parentdbff918e3a41e5e348f3d501d899c463a409f93e (diff)
downloadAntennaPod-8a2332f8533d90fd03f58dbe4cf8143b1aa989d7.zip
Added support for podlove alternate feeds
http://podlove.org/alternate-feeds/
Diffstat (limited to 'src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java')
-rw-r--r--src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java b/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java
index 383b29fc8..2c8e232ff 100644
--- a/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java
+++ b/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java
@@ -92,7 +92,8 @@ public class NSAtom extends Namespace {
.getValidMimeTypeFromUrl(href)) != null) {
state.getCurrentItem().setMedia(
new FeedMedia(state.getCurrentItem(), href,
- size, type));
+ size, type)
+ );
}
} else if (rel.equals(LINK_REL_PAYMENT)) {
state.getCurrentItem().setPaymentLink(href);
@@ -101,13 +102,20 @@ public class NSAtom extends Namespace {
if (rel == null || rel.equals(LINK_REL_ALTERNATE)) {
String type = attributes.getValue(LINK_TYPE);
/*
- * Use as link if a) no type-attribute is given and
+ * Use as link if a) no type-attribute is given and
* feed-object has no link yet b) type of link is
* LINK_TYPE_HTML or LINK_TYPE_XHTML
*/
if ((type == null && state.getFeed().getLink() == null)
|| (type != null && (type.equals(LINK_TYPE_HTML) || type.equals(LINK_TYPE_XHTML)))) {
state.getFeed().setLink(href);
+ } else if (type != null && (type.equals(LINK_TYPE_ATOM) || type.equals(LINK_TYPE_RSS))) {
+ // treat as podlove alternate feed
+ String title = attributes.getValue(LINK_TITLE);
+ if (title == null) {
+ title = href;
+ }
+ state.addAlternateFeedUrl(title, href);
}
} else if (rel.equals(LINK_REL_PAYMENT)) {
state.getFeed().setPaymentLink(href);