Skip to content

refactor: migrate file access to native - #31608

Open
santoshakil wants to merge 9 commits into
refactor/photo-manager-2from
refactor/photo-manager-3
Open

santoshakil wants to merge 9 commits into
refactor/photo-manager-2from
refactor/photo-manager-3

Conversation

@santoshakil

Copy link
Copy Markdown
Member

Part 3 of the migration, file access. The original file, the live photo video, the original file name and the live photo flag now come from one native call instead of photo_manager.

iOS writes the resource with PHAssetResourceManager into a fresh file under Library/Caches/immich/originals on every call. The caller owns that copy and deletes it when done, the uploads and the share already did, the viewer now does too. Leftovers from a killed app are removed once at launch. Android returns the MediaStore path, nothing is copied. When the asset is gone the call returns null and the callers keep their old behaviour.

Two things change for a user. The old clearCache at backup start and cancel is gone, so a copy in use is never deleted under its reader anymore. Two callers on the same asset at the same moment make two copies for a few seconds instead of sharing one.

Tested on an iPhone XS against the photo_manager build on the same phone and albums: identical names, visibility, live photo pairs and checksums. The background path was checked as well and uploads the same rows as before. Medium and unit tests cover the repository and both upload services.

Future cleanup: play local videos through requestAVAsset instead of an export, delete the background copy right after enqueue, and get the live photo flag without exporting the still.

@immich-push-o-matic

immich-push-o-matic Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

📱 Android release APK (universal)7895208931e955ec001ffabeca0c338c7eafffd0

Download: https://github.com/immich-app/immich/actions/runs/35381235762/artifacts/10562697460

QR code QR code

Installs as a separate app (applicationId app.alextran.immich.pr31608), so it coexists with the Play Store version and any other PR builds.

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.

2 participants