summaryrefslogtreecommitdiff
path: root/core/src/main/java/de
diff options
context:
space:
mode:
authorBorjan Tchakaloff <borjan@tchakaloff.fr>2019-03-31 16:20:00 +0200
committerBorjan Tchakaloff <borjan@tchakaloff.fr>2019-03-31 16:28:05 +0200
commit6ebf1defe7153910dd3a7503ea215079814da7cb (patch)
tree4e0393d9f5b8271e00f3d157820e0df60cb78972 /core/src/main/java/de
parentcba4059063174922b5e1e0673bd02ede9b98b5d1 (diff)
downloadAntennaPod-6ebf1defe7153910dd3a7503ea215079814da7cb.zip
Validate that the item state is only changed when needed
Follow-up to commit 8172d87477dd593745d4776417ef3dd7884d17fb (#3067) that adds test coverage for the resolved issue. Also, fix that commit by making the update condition more explicit: the FeedItem state is only changed when a state switch is necessary. In other words, an item marked as *new* that gets downloaded should lose the *new* mark and gain the *unplayed* mark instead.
Diffstat (limited to 'core/src/main/java/de')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java
index 84346e2d4..f3a43e2d0 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java
@@ -594,7 +594,7 @@ public class FeedMedia extends FeedFile implements Playable {
@Override
public void setDownloaded(boolean downloaded) {
super.setDownloaded(downloaded);
- if(item != null && downloaded && !item.isPlayed()) {
+ if(item != null && downloaded && item.isNew()) {
item.setPlayed(false);
}
}