summaryrefslogtreecommitdiff
path: root/model/src
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2023-02-16 21:51:58 +0100
committerGitHub <noreply@github.com>2023-02-16 21:51:58 +0100
commitcaf49c5da8a2f541b099ff32c15a7e96e1c557e8 (patch)
tree1324e99353379708d2c70511e6fd7a38a39ad971 /model/src
parent7a2f4771ecd327665497f21606ebc9d6c9415fd1 (diff)
downloadAntennaPod-caf49c5da8a2f541b099ff32c15a7e96e1c557e8.zip
Update duration from feed if there is none yet (#6322)
Diffstat (limited to 'model/src')
-rw-r--r--model/src/main/java/de/danoeh/antennapod/model/feed/FeedMedia.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedMedia.java b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedMedia.java
index 2fb1a5c0c..9e8583075 100644
--- a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedMedia.java
+++ b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedMedia.java
@@ -128,6 +128,9 @@ public class FeedMedia extends FeedFile implements Playable {
if (other.size > 0) {
size = other.size;
}
+ if (other.duration > 0 && duration <= 0) { // Do not overwrite duration that we measured after downloading
+ duration = other.duration;
+ }
if (other.mime_type != null) {
mime_type = other.mime_type;
}
@@ -145,6 +148,9 @@ public class FeedMedia extends FeedFile implements Playable {
if (other.size > 0 && other.size != size) {
return true;
}
+ if (other.duration > 0 && duration <= 0) {
+ return true;
+ }
return false;
}