summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fietz <Martin.Fietz@gmail.com>2016-04-22 13:01:55 +0200
committerMartin Fietz <Martin.Fietz@gmail.com>2016-04-22 13:04:01 +0200
commit543651bde60ca00b5c91e7565fd214a8dbb2b91e (patch)
tree96c9982e761f2886ef28ac259c90dae16d8dabb9
parent69fad87166e6ed194d61a2f42f42993c0ea8103a (diff)
downloadAntennaPod-543651bde60ca00b5c91e7565fd214a8dbb2b91e.zip
Account for episodes that have same pubDate but don't appear in the feed at the same time
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java
index 47e2d8a26..75bbd4adc 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java
@@ -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();