mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-02-03 03:57:41 +01:00
Support mrss' thumbnail
Note, this only supports one image as that's all AntennaPod can at the moment.
This commit is contained in:
parent
8a7029ed78
commit
9562f1922a
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user