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