diff options
author | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-08-18 16:49:27 -0400 |
---|---|---|
committer | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-08-18 16:49:27 -0400 |
commit | 9e39a65e75dbfba155c7c475abd312953300ac3b (patch) | |
tree | 373d367ccbce0603c4b3c75fcc624374bad8f362 /core/src/main | |
parent | 003d3f92a31090b2c0a7515fdb20583a9ca337e0 (diff) | |
parent | bf93cf3259d1464d9c9d99b32b362676845c7700 (diff) | |
download | AntennaPod-9e39a65e75dbfba155c7c475abd312953300ac3b.zip |
Merge pull request #1104 from TomHennen/fix1102
not every action has a timestamp
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java b/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java index b80b4303f..7878d19a0 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java @@ -230,7 +230,7 @@ public class GpodnetSyncService extends Service { for(GpodnetEpisodeAction action : localActions) { Pair key = new Pair(action.getPodcast(), action.getEpisode()); GpodnetEpisodeAction mostRecent = localMostRecentPlayAction.get(key); - if (mostRecent == null) { + if (mostRecent == null || mostRecent.getTimestamp() == null) { localMostRecentPlayAction.put(key, action); } else if (mostRecent.getTimestamp().before(action.getTimestamp())) { localMostRecentPlayAction.put(key, action); @@ -255,9 +255,10 @@ public class GpodnetSyncService extends Service { Pair key = new Pair(action.getPodcast(), action.getEpisode()); GpodnetEpisodeAction localMostRecent = localMostRecentPlayAction.get(key); if(localMostRecent == null || + localMostRecent.getTimestamp() == null || localMostRecent.getTimestamp().before(action.getTimestamp())) { GpodnetEpisodeAction mostRecent = mostRecentPlayAction.get(key); - if (mostRecent == null) { + if (mostRecent == null || mostRecent.getTimestamp() == null) { mostRecentPlayAction.put(key, action); } else if (mostRecent.getTimestamp().before(action.getTimestamp())) { mostRecentPlayAction.put(key, action); |