Update duration from feed if there is none yet ()

This commit is contained in:
ByteHamster 2023-02-16 21:51:58 +01:00 committed by GitHub
parent 7a2f4771ec
commit caf49c5da8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -128,6 +128,9 @@ public class FeedMedia extends FeedFile implements Playable {
if (other.size > 0) { if (other.size > 0) {
size = other.size; 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) { if (other.mime_type != null) {
mime_type = other.mime_type; mime_type = other.mime_type;
} }
@ -145,6 +148,9 @@ public class FeedMedia extends FeedFile implements Playable {
if (other.size > 0 && other.size != size) { if (other.size > 0 && other.size != size) {
return true; return true;
} }
if (other.duration > 0 && duration <= 0) {
return true;
}
return false; return false;
} }