Skip to content

feat(mobile): enable local motion photo playback#27004

Closed
dnplkndll wants to merge 1 commit intoimmich-app:mainfrom
dnplkndll:pr/local-motion-photo-playback
Closed

feat(mobile): enable local motion photo playback#27004
dnplkndll wants to merge 1 commit intoimmich-app:mainfrom
dnplkndll:pr/local-motion-photo-playback

Conversation

@dnplkndll
Copy link

@dnplkndll dnplkndll commented Mar 18, 2026

Description

Enables local (on-device) motion photos and live photos to play in the asset viewer. Previously only remote assets triggered the video component — assets with a local copy never animated.

This is a cleaned-up version of the work started by @LeLunZ in draft PR #26784. The prerequisite playbackStyle infrastructure from that series (#26541, #26596, #26747) was merged but the motion photo playback follow-up was left as a draft. This PR completes that work, resolves a circular dependency in base_asset.model.dart that appeared after the infrastructure landed, and polishes it for submission. All credit for the core approach goes to @LeLunZ.

Fixes #23525

video_viewer.widget.dart

  • Check videoAsset.isMotionPhoto to select the right local file: motion assets use getMotionFileById (fetches the paired subtype via originFileWithSubtype), regular videos use getFileForAsset

thumbnail_tile.widget.dart

  • Changed the live-photo badge check from asset is RemoteAsset && asset.livePhotoVideoId != null to asset.isMotionPhoto — shows the icon for local motion photos too

storage.repository.dart

  • Extracted getMotionFileById(String assetId) from getMotionFileForAsset(LocalAsset asset) so the viewer can call it with a raw ID (needed when the resolved asset is a RemoteAsset with a localId)

base_asset.model.dart

  • Fixed circular dependency: isMotionPhoto delegates to playbackStyle; playbackStyle uses livePhotoVideoId != null directly
  • Added doc comment covering both remote (livePhotoVideoId) and local (resolved playback style) paths

Happy to make any changes before merging. @LeLunZ — if there was anything else you had planned for the original PR, please let me know and I'll incorporate it.

How Has This Been Tested?

  • Verified local motion photos animate in the asset viewer on iOS (iPhone 15 Pro, iOS 18)
  • Verified live photo badge appears on local-only motion photos in the timeline grid
  • Full unit test suite (701 tests) passes with no regressions

Screenshots (if appropriate)

Checklist:

  • I have carefully read CONTRIBUTING.md
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

Please describe to which degree, if any, an LLM was used in creating this pull request.

Claude (claude-sonnet-4-6) was used to assist with code review, refactoring suggestions, and drafting the PR description. All code changes were reviewed and tested manually on device.

@immich-push-o-matic
Copy link

immich-push-o-matic bot commented Mar 18, 2026

Label error. Requires exactly 1 of: changelog:.*. Found: 📱mobile, llm-generated. A maintainer will add the required label.

@github-actions
Copy link
Contributor

This PR has been automatically closed as the description doesn't follow our template. After you edit it to match the template, the PR will automatically be reopened.

@github-actions github-actions bot closed this Mar 18, 2026
@github-actions github-actions bot reopened this Mar 18, 2026
@dnplkndll dnplkndll marked this pull request as ready for review March 18, 2026 03:13
@github-actions
Copy link
Contributor

Thank you for your interest in contributing to Immich! Unfortunately this PR looks like it was generated using an LLM. As noted in our CONTRIBUTING.md, we request that you don't use LLMs to generate PRs as those are not a good use of maintainer time.

@github-actions github-actions bot closed this Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Live (Motion) photos do not play on Android without connection

3 participants