diff --git a/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java b/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java index dbe1334b6..5cfec16cb 100644 --- a/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java +++ b/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java @@ -20,6 +20,7 @@ public class NSAtom extends Namespace { public static final String NSURI = "http://www.w3.org/2005/Atom"; private static final String FEED = "feed"; + private static final String ID = "id"; private static final String TITLE = "title"; private static final String ENTRY = "entry"; private static final String LINK = "link"; @@ -50,7 +51,7 @@ public class NSAtom extends Namespace { public static final String isFeed = FEED + "|" + NSRSS20.CHANNEL; public static final String isFeedItem = ENTRY + "|" + NSRSS20.ITEM; - + @Override public SyndElement handleElementStart(String localName, HandlerState state, Attributes attributes) { @@ -93,7 +94,6 @@ public class NSAtom extends Namespace { return new SyndElement(localName, this); } - @Override public void handleElementEnd(String localName, HandlerState state) { if (localName.equals(ENTRY)) { @@ -113,7 +113,11 @@ public class NSAtom extends Namespace { textElement.setContent(content); } - if (top.equals(TITLE)) { + if (top.equals(ID)) { + if (second.equals(ENTRY)) { + state.getCurrentItem().setItemIdentifier(content); + } + } else if (top.equals(TITLE)) { if (second.equals(FEED)) { state.getFeed().setTitle(textElement.getProcessedContent()); diff --git a/src/de/danoeh/antennapod/syndication/namespace/rss20/NSRSS20.java b/src/de/danoeh/antennapod/syndication/namespace/rss20/NSRSS20.java index 3bd69f049..e6c62eab8 100644 --- a/src/de/danoeh/antennapod/syndication/namespace/rss20/NSRSS20.java +++ b/src/de/danoeh/antennapod/syndication/namespace/rss20/NSRSS20.java @@ -29,6 +29,7 @@ public class NSRSS20 extends Namespace { public final static String CHANNEL = "channel"; public final static String ITEM = "item"; + public final static String GUID = "guid"; public final static String TITLE = "title"; public final static String LINK = "link"; public final static String DESCR = "description"; @@ -80,7 +81,10 @@ public class NSRSS20 extends Namespace { String top = topElement.getName(); SyndElement secondElement = state.getSecondTag(); String second = secondElement.getName(); - if (top.equals(TITLE)) { + + if (top.equals(GUID) && second.equals(ITEM)) { + state.getCurrentItem().setItemIdentifier(content); + } else if (top.equals(TITLE)) { if (second.equals(ITEM)) { state.getCurrentItem().setTitle(content); } else if (second.equals(CHANNEL)) { @@ -102,7 +106,7 @@ public class NSRSS20 extends Namespace { } else if (localName.equals(DESCR)) { if (second.equals(CHANNEL)) { state.getFeed().setDescription(content); - } else if (second.equals(ITEM)){ + } else if (second.equals(ITEM)) { state.getCurrentItem().setDescription(content); }