From 9d30e697e61c1af61cbcc2789c87dc05c1265c8b Mon Sep 17 00:00:00 2001 From: daniel oeh Date: Mon, 17 Feb 2014 22:32:02 +0100 Subject: [PATCH] Resolved issue with guids in rss 2 feeds. fixes #351 and #336 --- src/de/danoeh/antennapod/feed/FeedItem.java | 4 ++-- src/de/danoeh/antennapod/syndication/namespace/NSRSS20.java | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/de/danoeh/antennapod/feed/FeedItem.java b/src/de/danoeh/antennapod/feed/FeedItem.java index eaae6ae5e..f63b5beb4 100644 --- a/src/de/danoeh/antennapod/feed/FeedItem.java +++ b/src/de/danoeh/antennapod/feed/FeedItem.java @@ -107,9 +107,9 @@ public class FeedItem extends FeedComponent implements * of the entry. */ public String getIdentifyingValue() { - if (itemIdentifier != null) { + if (itemIdentifier != null && !itemIdentifier.isEmpty()) { return itemIdentifier; - } else if (title != null) { + } else if (title != null && !title.isEmpty()) { return title; } else { return link; diff --git a/src/de/danoeh/antennapod/syndication/namespace/NSRSS20.java b/src/de/danoeh/antennapod/syndication/namespace/NSRSS20.java index 5a2c6005e..3eb49172d 100644 --- a/src/de/danoeh/antennapod/syndication/namespace/NSRSS20.java +++ b/src/de/danoeh/antennapod/syndication/namespace/NSRSS20.java @@ -101,7 +101,10 @@ public class NSRSS20 extends Namespace { } if (top.equals(GUID) && second.equals(ITEM)) { - state.getCurrentItem().setItemIdentifier(content); + // some feed creators include an empty or non-standard guid-element in their feed, which should be ignored + if (!content.isEmpty()) { + state.getCurrentItem().setItemIdentifier(content); + } } else if (top.equals(TITLE)) { if (second.equals(ITEM)) { state.getCurrentItem().setTitle(content);