FeedManager will now find new FeedItems by looking at the identifying

value of the item
This commit is contained in:
daniel oeh 2012-07-31 19:51:14 +02:00
parent cc7a84ee35
commit bc2eae53a8

View File

@ -352,8 +352,8 @@ public class FeedManager {
// Look for new or updated Items
for (int idx = 0; idx < newFeed.getItems().size(); idx++) {
FeedItem item = newFeed.getItems().get(idx);
FeedItem oldItem = searchFeedItemByTitle(savedFeed,
item.getTitle());
FeedItem oldItem = searchFeedItemByIdentifyingValue(savedFeed,
item.getIdentifyingValue());
if (oldItem == null) {
// item is new
item.setFeed(savedFeed);
@ -380,10 +380,11 @@ public class FeedManager {
return null;
}
/** Get a FeedItem by its link */
private FeedItem searchFeedItemByTitle(Feed feed, String title) {
/** Get a FeedItem by its identifying value. */
private FeedItem searchFeedItemByIdentifyingValue(Feed feed,
String identifier) {
for (FeedItem item : feed.getItems()) {
if (item.getTitle().equals(title)) {
if (item.getIdentifyingValue().equals(identifier)) {
return item;
}
}