If atom feed item has multiple enclosures, use first one

This commit is contained in:
Martin Fietz 2016-01-17 14:19:08 +01:00
parent 19fb75addf
commit 2662f5828f
1 changed files with 4 additions and 4 deletions

View File

@ -91,11 +91,11 @@ public class NSAtom extends Namespace {
}
String type = attributes.getValue(LINK_TYPE);
if (SyndTypeUtils.enclosureTypeValid(type)
state.getCurrentItem().setMedia(
new FeedMedia(state.getCurrentItem(), href,
size, type)
);
|| (type = SyndTypeUtils.getValidMimeTypeFromUrl(href)) != null) {
FeedItem currItem = state.getCurrentItem();
if(!currItem.hasMedia()) {
currItem.setMedia(new FeedMedia(currItem, href, size, type));
}
}
} else if (rel.equals(LINK_REL_PAYMENT)) {
state.getCurrentItem().setPaymentLink(href);