From caf49c5da8a2f541b099ff32c15a7e96e1c557e8 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Thu, 16 Feb 2023 21:51:58 +0100 Subject: [PATCH] Update duration from feed if there is none yet (#6322) --- .../java/de/danoeh/antennapod/model/feed/FeedMedia.java | 6 ++++++ 1 file changed, 6 insertions(+) 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; }