Skip to content

fix(videos): use live photo metadata for poster - #177

Open
bulungasdeveloper wants to merge 1 commit into
nextcloud-libraries:mainfrom
bulungasdeveloper:fix/livephoto-video-metadata
Open

bulungasdeveloper wants to merge 1 commit into
nextcloud-libraries:mainfrom
bulungasdeveloper:fix/livephoto-video-metadata

Conversation

@bulungasdeveloper

Copy link
Copy Markdown

Summary

A video and a picture with the same name are not necessarily halves of the same live photo.
Resolve the poster through the DAV live photo metadata when the video carries it, and keep the
name pairing only for videos without metadata. A picture that already belongs to another live
photo is not used as a poster by name.

This makes video poster resolution symmetric with the image path, which already uses metadata.

How to test

  1. Upload a live photo pair where the still and the video have different names.
  2. Open the video in the viewer.
  3. The poster should be the correct still frame resolved via metadata-files-live-photo.
  4. Rename the still; the poster remains correct.

Unit tests added in __tests__/component/media.spec.ts and __tests__/utils.spec.ts.

Checklist

  • Code is properly formatted (eslint)
  • Sign-off message is added to all commits
  • Tests are included
  • Documentation not required
  • Backports requested where applicable: none for main

AI

  • The content of this PR was partly generated using AI

Resolve a video's poster from the live photo metadata before
falling back to the picture beside it. The metadata links both
halves by file id, so a video whose picture has a different name
still shows the right poster.

Keep the name fallback for videos without metadata, but never
pair a video with an image that belongs to another live photo.

Assisted-by: opencode:deepseek-v4.1-flash-free
Signed-off-by: Braux Martinez <martinezjb@hitss.com>
@bulungasdeveloper
bulungasdeveloper force-pushed the fix/livephoto-video-metadata branch from 2976b01 to 985573e Compare October 23, 2026 20:06
@bulungasdeveloper

Copy link
Copy Markdown
Author

Hi maintainers,
The branch has been rebased on top of main to remove the non-conventional merge commit created by Update branch.
Commit is conventional, DCO signed and AI-assisted.
The required checks are currently pending action_required due to fork protection. Could someone approve the workflow runs or review? Thanks!

@skjnldsv
skjnldsv requested a review from artonge October 24, 2026 18:14
@skjnldsv

Copy link
Copy Markdown
Contributor

@bulungasdeveloper thanks for the PR!

@artonge what do you think of that ? You have more knowledge than me on live photos metadata :))

@codecov

codecov Bot commented Oct 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.04%. Comparing base (bf78e93) to head (985573e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #177   +/-   ##
=======================================
  Coverage   92.03%   92.04%           
=======================================
  Files          54       54           
  Lines        4607     4611    +4     
  Branches     1002     1005    +3     
=======================================
+ Hits         4240     4244    +4     
  Misses        342      342           
  Partials       25       25           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants