Account for episodes that have same pubDate but don't appear in the feed at the same time

This commit is contained in:
Martin Fietz 2016-04-22 13:01:55 +02:00
parent 69fad87166
commit 543651bde6
1 changed files with 4 additions and 3 deletions

View File

@ -577,12 +577,13 @@ public final class DBTasks {
item.setAutoDownload(savedFeed.getPreferences().getAutoDownload());
savedFeed.getItems().add(idx, item);
// only mark the item new if it actually occurs
// before the most recent item (before we started adding things)
// only mark the item new if it was published after or at the same time
// as the most recent item
// (if the most recent date is null then we can assume there are no items
// and this is the first, hence 'new')
if (priorMostRecentDate == null ||
priorMostRecentDate.before(item.getPubDate())) {
priorMostRecentDate.before(item.getPubDate()) ||
priorMostRecentDate.equals(item.getPubDate())) {
Log.d(TAG, "Marking item published on " + item.getPubDate() +
" new, prior most recent date = " + priorMostRecentDate);
item.setNew();