summaryrefslogtreecommitdiff
path: root/core/src/main/java
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2014-10-20 22:51:26 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2014-10-20 22:51:26 +0200
commitb5066d02b4acf31da093190a1a57a9d961bb04ca (patch)
treeeff443d5ebf0f411e8a449c4f86e6c6ed7de36ee /core/src/main/java
parent2cd504b9d093203e5861f3cbe917a07bbc92c70e (diff)
downloadAntennaPod-b5066d02b4acf31da093190a1a57a9d961bb04ca.zip
Set image owner when parsing feed
Diffstat (limited to 'core/src/main/java')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/feed/FeedImage.java11
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java2
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java1
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java2
4 files changed, 10 insertions, 6 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedImage.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedImage.java
index 51605691d..b01747f7f 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedImage.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedImage.java
@@ -13,10 +13,11 @@ public class FeedImage extends FeedFile implements PicassoImageResource {
protected String title;
protected FeedComponent owner;
- public FeedImage(String download_url, String title) {
+ public FeedImage(FeedComponent owner, String download_url, String title) {
super(null, download_url, false);
this.download_url = download_url;
this.title = title;
+ this.owner = owner;
}
public FeedImage(long id, String title, String file_url,
@@ -26,6 +27,10 @@ public class FeedImage extends FeedFile implements PicassoImageResource {
this.title = title;
}
+ public FeedImage() {
+ super();
+ }
+
@Override
public String getHumanReadableIdentifier() {
if (owner != null && owner.getHumanReadableIdentifier() != null) {
@@ -40,10 +45,6 @@ public class FeedImage extends FeedFile implements PicassoImageResource {
return FEEDFILETYPE_FEEDIMAGE;
}
- public FeedImage() {
- super();
- }
-
public String getTitle() {
return title;
}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java
index 7f07b54f6..70e1126b9 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java
@@ -29,11 +29,13 @@ public class NSITunes extends Namespace {
if (state.getCurrentItem() != null) {
// this is an items image
image.setTitle(state.getCurrentItem().getTitle()+IMAGE_TITLE);
+ image.setOwner(state.getCurrentItem());
state.getCurrentItem().setImage(image);
} else {
// this is the feed image
if (state.getFeed().getImage() == null) {
+ image.setOwner(state.getFeed());
state.getFeed().setImage(image);
}
}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java
index ba26dbac2..0ca261a0e 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java
@@ -68,6 +68,7 @@ public class NSRSS20 extends Namespace {
String parent = state.getTagstack().peek().getName();
if (parent.equals(CHANNEL)) {
state.getFeed().setImage(new FeedImage());
+ state.getFeed().getImage().setOwner(state.getFeed());
}
}
}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java
index 3719e7103..1de001c55 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java
@@ -193,7 +193,7 @@ public class NSAtom extends Namespace {
SyndDateUtils.parseRFC3339Date(content));
}
} else if (top.equals(IMAGE)) {
- state.getFeed().setImage(new FeedImage(content, null));
+ state.getFeed().setImage(new FeedImage(state.getFeed(), content, null));
}
}