diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java index 7e4e090b4..965ff691e 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java @@ -23,6 +23,7 @@ public class NSMedia extends Namespace { private static final String SIZE = "fileSize"; private static final String MIME_TYPE = "type"; private static final String DURATION = "duration"; + private static final String DEFAULT = "isDefault"; @Override public SyndElement handleElementStart(String localName, HandlerState state, @@ -30,14 +31,21 @@ public class NSMedia extends Namespace { if (CONTENT.equals(localName)) { String url = attributes.getValue(DOWNLOAD_URL); String type = attributes.getValue(MIME_TYPE); + String defaultStr = attributes.getValue(DEFAULT); boolean validType; + boolean isDefault = false; if (SyndTypeUtils.enclosureTypeValid(type)) { validType = true; } else { type = SyndTypeUtils.getValidMimeTypeFromUrl(url); validType = type != null; } - if (state.getCurrentItem() != null && state.getCurrentItem().getMedia() == null && + + if (defaultStr == "true") + isDefault = true; + + if (state.getCurrentItem() != null && + (state.getCurrentItem().getMedia() == null || isDefault) && url != null && validType) { long size = 0; String sizeStr = attributes.getValue(SIZE); @@ -71,4 +79,5 @@ public class NSMedia extends Namespace { public void handleElementEnd(String localName, HandlerState state) { } -} \ No newline at end of file +} +