summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java19
1 files changed, 19 insertions, 0 deletions
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 965ff691e..5b7f8f5c5 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
@@ -25,6 +25,9 @@ public class NSMedia extends Namespace {
private static final String DURATION = "duration";
private static final String DEFAULT = "isDefault";
+ private static final String IMAGE = "thumbnail";
+ private static final String IMAGE_URL = "url";
+
@Override
public SyndElement handleElementStart(String localName, HandlerState state,
Attributes attributes) {
@@ -71,6 +74,22 @@ public class NSMedia extends Namespace {
}
state.getCurrentItem().setMedia(media);
}
+ } else if (IMAGE.equals(localName)) {
+ String url = attributes.getValue(IMAGE_URL);
+ if (url != null) {
+ FeedImage image = new FeedImage();
+ image.setDownload_url(url);
+
+ if (state.getCurrentItem() != null) {
+ image.setOwner(state.getCurrentItem());
+ state.getCurrentItem().setImage(image);
+ } else {
+ if (state.getFeed().getImage() == null) {
+ image.setOwner(state.getFeed());
+ state.getFeed().setImage(image);
+ }
+ }
+ }
}
return new SyndElement(localName, this);
}