Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle livePhotos using originFileWithSubType #5602

Merged
merged 6 commits into from
Dec 12, 2023

Conversation

shenlong-tanwen
Copy link
Member

Changes made:

  • Live photo video assets are fetched using originFileWithSubtype
  • isLocallyAvailable now checks for the existence of the originFile

@alextran1502
Copy link
Contributor

The latest changes somehow caused the MOV portion to be uploaded as an image and the server wasn't able to generate thumbnails or perform other processes on it

@shenlong-tanwen
Copy link
Member Author

The latest changes somehow caused the MOV portion to be uploaded as an image and the server wasn't able to generate thumbnails or perform other processes on it

Fixed. Thank you! The titleAsyncWithSubType was not returning the proper video name as I thought. Previously, we used to fetch the video file name from the base path of the video file. This is resulting in huge file name with a UUID. I've updated the handling to use the same name as the image file with the extension of the video file. Should we leave it this way or go back to using the base path of the video file instead?

The image file name: "IMG_2211.HEIC"

The video file name:
The X are random numbers. Probably some meta related to where it is stored along with it's timestamp.
Before (base path): "3B5DB4FE-9B59-4C08-B2F4-4D5C83FC50BB_XX_XXX_XXXXXXXXXX.XXXXXX_o_IMG_2211.MOV"
After (image name + video ext): "IMG_2211.MOV"

Also, I've verified upload and download of a live photo available locally. Can you test if the same works for a live photo directly from iCloud? Need to confirm that the following actually returns the video file as well

livePhotoFile = await entity.loadFile(
withSubtype: true,
progressHandler: pmProgressHandler,

@alextran1502 alextran1502 merged commit fb4b4e5 into main Dec 12, 2023
18 checks passed
@alextran1502 alextran1502 deleted the fix/mobile-livePhoto-upload branch December 12, 2023 02:20
jonhnet pushed a commit to jonhnet/immich that referenced this pull request Dec 15, 2023
* fix: handle livePhotos using originFileWithSubType

* remove livePhoto asset cache

* fetch live photo video name from entity

* fix: video file not detected

* chore: pull main

* fix: set correct header

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
Co-authored-by: Alex <alex.tran1502@gmail.com>
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.

None yet

2 participants