π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Remember absent motion photo metadata
Neeraj Gupta753511dd2f9d
diff --git a/mobile/apps/photos/lib/ui/viewer/file/live_image_long_press_router.dart b/mobile/apps/photos/lib/ui/viewer/file/live_image_long_press_router.dartindex 347c8eb88b..56913b72b2 100644--- a/mobile/apps/photos/lib/ui/viewer/file/live_image_long_press_router.dart+++ b/mobile/apps/photos/lib/ui/viewer/file/live_image_long_press_router.dart@@ -4,9 +4,13 @@ enum LiveImageLongPressAction { playback, textSelection }class LiveImageLongPressRouter {LiveImageLongPressRouter({- required MotionPhotoAvailability initialAvailability,+ required int? motionVideoIndex,required Future<MotionPhotoAvailability> Function() probeMotionPhoto,- }) : _availability = initialAvailability,+ }) : _availability = switch (motionVideoIndex) {+ final index? when index > 0 => MotionPhotoAvailability.present,+ 0 => MotionPhotoAvailability.absent,+ _ => MotionPhotoAvailability.unknown,+ },_probeMotionPhoto = probeMotionPhoto;MotionPhotoAvailability _availability;diff --git a/mobile/apps/photos/lib/ui/viewer/file/zoomable_live_image_new.dart b/mobile/apps/photos/lib/ui/viewer/file/zoomable_live_image_new.dartindex 8dfe2ab806..70e5930c81 100644--- a/mobile/apps/photos/lib/ui/viewer/file/zoomable_live_image_new.dart+++ b/mobile/apps/photos/lib/ui/viewer/file/zoomable_live_image_new.dart@@ -68,10 +68,7 @@ class _ZoomableLiveImageNewState extends State<ZoomableLiveImageNew>_enteFile = widget.enteFile;_longPressRouter = LiveImageLongPressRouter(- initialAvailability: switch (_enteFile.pubMagicMetadata?.mvi) {- final index? when index > 0 => MotionPhotoAvailability.present,- _ => MotionPhotoAvailability.unknown,- },+ motionVideoIndex: _enteFile.pubMagicMetadata?.mvi,probeMotionPhoto: _loadLiveVideo,);_logger.info(diff --git a/mobile/apps/photos/test/ui/viewer/file/live_image_long_press_router_test.dart b/mobile/apps/photos/test/ui/viewer/file/live_image_long_press_router_test.dartindex bc8a3badc1..926ed6097b 100644--- a/mobile/apps/photos/test/ui/viewer/file/live_image_long_press_router_test.dart+++ b/mobile/apps/photos/test/ui/viewer/file/live_image_long_press_router_test.dart@@ -5,7 +5,7 @@ void main() {test("untagged motion photos retain playback after probing", () async {var probes = 0;final router = LiveImageLongPressRouter(- initialAvailability: MotionPhotoAvailability.unknown,+ motionVideoIndex: null,probeMotionPhoto: () async {probes++;return MotionPhotoAvailability.present;@@ -20,7 +20,7 @@ void main() {test("untagged still photos fall back to text selection", () async {var probes = 0;final router = LiveImageLongPressRouter(- initialAvailability: MotionPhotoAvailability.unknown,+ motionVideoIndex: null,probeMotionPhoto: () async {probes++;return MotionPhotoAvailability.absent;@@ -31,4 +31,18 @@ void main() {expect(await router.resolve(), LiveImageLongPressAction.textSelection);expect(probes, 1);});++ test("an explicit absent marker skips the motion photo probe", () async {+ var probes = 0;+ final router = LiveImageLongPressRouter(+ motionVideoIndex: 0,+ probeMotionPhoto: () async {+ probes++;+ return MotionPhotoAvailability.present;+ },+ );++ expect(await router.resolve(), LiveImageLongPressAction.textSelection);+ expect(probes, 0);+ });}