Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds support for MXF (Material Exchange Format) video files in Immich.
What was added:
.mxfextension to the supported video formats listapplication/mxfas the mime type for MXF files (official SMPTE mime type)Technical details:
MXF is a container format with the mime type
application/mxf(notvideo/mxf). TheassetType()function was updated to check file extensions first (against thevideoandimageobjects) before falling back to mime type prefixes. This ensures container formats like MXF are correctly classified based on their extension listing, regardless of mime type prefix.Rationale for 5316bcf:
Container formats (MXF, MOV, MP4, MKV, WebM) can have non-standard mime types. File extensions are more reliable for classification since Immich maintains explicit extension lists for video/image types. By checking extensions first, we ensure that any file extension listed in the
videoobject is correctly classified asAssetType.Video, enabling proper playback, thumbnail generation, and metadata extraction.Fixes #24640
How Has This Been Tested?
application/mxfin video mime types validationAssetType.Videoduring upload/api/assets/{id}/video/playback)Sample files downloaded from https://toolsfairy.com/video-test/sample-mxf-files were used to test the implementation.
Screenshots
Note: the last file upload fails due to size constraints of github codespaces (also happens on standard .mov files)
https://github.com/user-attachments/assets/3e3c895c-cb4b-4f3d-a9eb-299e3130d6b7
Checklist:
src/services/uses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services/)Please describe to which degree, if any, an LLM was used in creating this pull request.
Used LLM assistance to research MXF mime type specifications and identify the classification logic issue.