Fixed Feed syncing

This commit is contained in:
daniel oeh 2012-06-14 14:45:32 +02:00
parent 922b868914
commit ee9662e73d
1 changed files with 6 additions and 10 deletions

View File

@ -39,7 +39,7 @@ public class FeedManager {
public void refreshAllFeeds(Context context) {
Log.d(TAG, "Refreshing all feeds.");
for (Feed feed : feeds) {
requester.downloadFeed(context, feed);
requester.downloadFeed(context, new Feed(feed.getDownload_url(), new Date()));
}
}
@ -85,17 +85,13 @@ public class FeedManager {
for (FeedItem item : newFeed.getItems()) {
FeedItem oldItem = searchFeedItemByLink(savedFeed,
item.getLink());
if (oldItem != null) {
FeedItem newItem = searchFeedItemByLink(newFeed,
item.getLink());
if (newItem != null) {
newItem.setRead(oldItem.isRead());
}
if (oldItem == null) {
// item is new
savedFeed.getItems().add(item);
}
}
newFeed.setId(savedFeed.getId());
savedFeed = newFeed;
setFeed(context, newFeed);
savedFeed.setLastUpdate(newFeed.getLastUpdate());
setFeed(context, savedFeed);
}
}