Skip to content

fix(server): queue thumbnail generation for hidden motion-photo companion videos#29847

Open
tech00exploere wants to merge 1 commit into
immich-app:mainfrom
tech00exploere:fix-motion-photo-thumbnail-404
Open

fix(server): queue thumbnail generation for hidden motion-photo companion videos#29847
tech00exploere wants to merge 1 commit into
immich-app:mainfrom
tech00exploere:fix-motion-photo-thumbnail-404

Conversation

@tech00exploere

@tech00exploere tech00exploere commented Jul 12, 2026

Copy link
Copy Markdown

Description

When video conversion completed without requiring transcoding, hidden motion-photo companion videos never had thumbnail generation triggered. Since hidden assets are excluded from the batch thumbnail generation queue, the required preview and thumbnail files were never created, causing companion video thumbnail requests to return Asset media not found.

This change fixes the thumbnail generation flow by:

  • Queueing AssetGenerateThumbnails after video conversion completes, including when transcoding is skipped.
  • Allowing hidden motion-photo companion videos to generate the preview and thumbnail files required for playback.
  • Removing the previous approach of creating an EncodedVideo asset file for the original media, since thumbnail generation already operates directly on the original video.

Fixes #29846

How Has This Been Tested?

  • Added regression tests covering the no-transcode video conversion path.
  • Verified that thumbnail generation is queued when video conversion completes without transcoding.
  • Verified that no EncodedVideo asset file is created when transcoding is skipped.
  • Ran the updated server unit tests covering the modified behavior.

Screenshots (if appropriate)

N/A

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.

An LLM was used to help analyze the existing codebase and discuss possible approaches. The implementation, debugging, testing, and final validation were completed manually.

@immich-push-o-matic

Copy link
Copy Markdown

Label error. Requires exactly 1 of: changelog:.*. Found: 🗄️server. A maintainer will add the required label.

@bo0tzz

bo0tzz commented Jul 12, 2026

Copy link
Copy Markdown
Member

The original path is not a video, nor a generated file. This also just tries to patch over another problem (some jobs that failed), and seems to break some existing branching.

@tech00exploere

Copy link
Copy Markdown
Author

Thanks for the feedback. I see your point that using the original path as an encoded_video asset file breaks the intended semantics of that file type. I'll investigate why thumbnail generation expects an encoded video in this case and whether the correct fix is to fall back to the original media or address the earlier job that leaves the asset in this state.

…deos

- Remove the visibility skip check in handleGenerateThumbnails to allow thumbnail generation for hidden assets (like motion-photo companion videos).
- Queue AssetGenerateThumbnails after handleVideoConversion completes, ensuring both transcoded and skip-transcode videos get their thumbnails generated.
@tech00exploere tech00exploere force-pushed the fix-motion-photo-thumbnail-404 branch from 9eaa2e5 to 0f63cb2 Compare July 12, 2026 15:20
@github-actions

Copy link
Copy Markdown
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 Jul 12, 2026
@github-actions github-actions Bot reopened this Jul 12, 2026
@tech00exploere tech00exploere changed the title fix(server): create encoded video record when transcoding is skipped fix(server): queue thumbnail generation for hidden motion-photo companion videos Jul 12, 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.

Motion Photo companion assets return 404 thumbnails when encoded_video asset_file row is missing

3 participants