diff --git a/Fly App/lib/flight_model.dart b/Fly App/lib/flight_model.dart index 7509713..6f6f2cd 100644 --- a/Fly App/lib/flight_model.dart +++ b/Fly App/lib/flight_model.dart @@ -36,9 +36,13 @@ class MediaItem { /// On-disk path of the fully downloaded original, once available. String? localPath; + /// `null` for anything that shouldn't carry a duration. The SDK reports + /// `durationInSeconds` for *every* file, so stills come back with junk — + /// a Mavic Pro's photos yielded -36:35, -136:23 and 545:26 on the SD card. String? get durationLabel { - if (durationSeconds == null) return null; - final int s = durationSeconds!; + if (!isVideo) return null; + final int? s = durationSeconds; + if (s == null || s <= 0) return null; final String mm = (s ~/ 60).toString(); final String ss = (s % 60).toString().padLeft(2, '0'); return '$mm:$ss';