Suport archive RSS/Atom links as alternate feeds

This commit is contained in:
Cj Malone 2016-10-06 09:40:18 +01:00
parent 7fe1e07048
commit 85e08a270a
1 changed files with 12 additions and 0 deletions

View File

@ -45,6 +45,7 @@ public class NSAtom extends Namespace {
private static final String LINK_LENGTH = "length";
// rel-values
private static final String LINK_REL_ALTERNATE = "alternate";
private static final String LINK_REL_ARCHIVES = "archives";
private static final String LINK_REL_ENCLOSURE = "enclosure";
private static final String LINK_REL_PAYMENT = "payment";
private static final String LINK_REL_RELATED = "related";
@ -130,6 +131,17 @@ public class NSAtom extends Namespace {
}
state.addAlternateFeedUrl(title, href);
}
} else if (LINK_REL_ARCHIVES.equals(rel) && state.getFeed() != null) {
String type = attributes.getValue(LINK_TYPE);
if (LINK_TYPE_ATOM.equals(type) || LINK_TYPE_RSS.equals(type)) {
String title = attributes.getValue(LINK_TITLE);
if (TextUtils.isEmpty(title)) {
title = href;
}
state.addAlternateFeedUrl(title, href);
} else if (LINK_TYPE_HTML.equals(type) || LINK_TYPE_XHTML.equals(type)) {
//A Link such as to a directory such as iTunes
}
} else if (LINK_REL_PAYMENT.equals(rel) && state.getFeed() != null) {
state.getFeed().setPaymentLink(href);
} else if (LINK_REL_NEXT.equals(rel) && state.getFeed() != null) {