Merge pull request #1333 from mfietz/issue/1332-gif-cover-art
Prefer iTunes image over everything else
This commit is contained in:
commit
f684342ff5
|
@ -1,11 +1,12 @@
|
|||
package de.danoeh.antennapod.core.syndication.namespace;
|
||||
|
||||
import de.danoeh.antennapod.core.feed.FeedImage;
|
||||
import de.danoeh.antennapod.core.syndication.handler.HandlerState;
|
||||
import org.xml.sax.Attributes;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import de.danoeh.antennapod.core.feed.FeedImage;
|
||||
import de.danoeh.antennapod.core.syndication.handler.HandlerState;
|
||||
|
||||
public class NSITunes extends Namespace {
|
||||
public static final String NSTAG = "itunes";
|
||||
public static final String NSURI = "http://www.itunes.com/dtds/podcast-1.0.dtd";
|
||||
|
@ -34,11 +35,10 @@ public class NSITunes extends Namespace {
|
|||
|
||||
} else {
|
||||
// this is the feed image
|
||||
if (state.getFeed().getImage() == null) {
|
||||
// prefer to all other images
|
||||
image.setOwner(state.getFeed());
|
||||
state.getFeed().setImage(image);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import android.util.Log;
|
|||
import org.xml.sax.Attributes;
|
||||
|
||||
import de.danoeh.antennapod.core.BuildConfig;
|
||||
import de.danoeh.antennapod.core.feed.Feed;
|
||||
import de.danoeh.antennapod.core.feed.FeedImage;
|
||||
import de.danoeh.antennapod.core.feed.FeedItem;
|
||||
import de.danoeh.antennapod.core.feed.FeedMedia;
|
||||
|
@ -73,8 +74,11 @@ public class NSRSS20 extends Namespace {
|
|||
if (state.getTagstack().size() >= 1) {
|
||||
String parent = state.getTagstack().peek().getName();
|
||||
if (parent.equals(CHANNEL)) {
|
||||
state.getFeed().setImage(new FeedImage());
|
||||
state.getFeed().getImage().setOwner(state.getFeed());
|
||||
Feed feed = state.getFeed();
|
||||
if(feed.getImage() == null) {
|
||||
feed.setImage(new FeedImage());
|
||||
feed.getImage().setOwner(state.getFeed());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -126,8 +130,10 @@ public class NSRSS20 extends Namespace {
|
|||
state.getFeed().setTitle(title);
|
||||
} else if (second.equals(IMAGE) && third != null
|
||||
&& third.equals(CHANNEL)) {
|
||||
if(state.getFeed().getImage().getTitle() == null) {
|
||||
state.getFeed().getImage().setTitle(title);
|
||||
}
|
||||
}
|
||||
} else if (top.equals(LINK)) {
|
||||
if (second.equals(CHANNEL)) {
|
||||
state.getFeed().setLink(content);
|
||||
|
@ -139,7 +145,9 @@ public class NSRSS20 extends Namespace {
|
|||
DateUtils.parse(content));
|
||||
} else if (top.equals(URL) && second.equals(IMAGE) && third != null
|
||||
&& third.equals(CHANNEL)) {
|
||||
if(state.getFeed().getImage().getDownload_url() == null) { // prefer itunes:image
|
||||
state.getFeed().getImage().setDownload_url(content);
|
||||
}
|
||||
} else if (localName.equals(DESCR)) {
|
||||
if (second.equals(CHANNEL)) {
|
||||
state.getFeed().setDescription(content);
|
||||
|
|
|
@ -199,8 +199,10 @@ public class NSAtom extends Namespace {
|
|||
DateUtils.parse(content));
|
||||
}
|
||||
} else if (top.equals(IMAGE)) {
|
||||
if(state.getFeed().getImage() == null) {
|
||||
state.getFeed().setImage(new FeedImage(state.getFeed(), content, null));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue