Resolved issue with guids in rss 2 feeds. fixes #351 and #336

This commit is contained in:
daniel oeh 2014-02-17 22:32:02 +01:00
parent 2afcb580bf
commit 9d30e697e6
2 changed files with 6 additions and 3 deletions

View File

@ -107,9 +107,9 @@ public class FeedItem extends FeedComponent implements
* of the entry. * of the entry.
*/ */
public String getIdentifyingValue() { public String getIdentifyingValue() {
if (itemIdentifier != null) { if (itemIdentifier != null && !itemIdentifier.isEmpty()) {
return itemIdentifier; return itemIdentifier;
} else if (title != null) { } else if (title != null && !title.isEmpty()) {
return title; return title;
} else { } else {
return link; return link;

View File

@ -101,7 +101,10 @@ public class NSRSS20 extends Namespace {
} }
if (top.equals(GUID) && second.equals(ITEM)) { 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)) { } else if (top.equals(TITLE)) {
if (second.equals(ITEM)) { if (second.equals(ITEM)) {
state.getCurrentItem().setTitle(content); state.getCurrentItem().setTitle(content);