Skip to content

[stable35] fix(videos): use live photo metadata for poster - #3461

Merged
susnux merged 4 commits into
nextcloud:stable35from
bulungasdeveloper:fix-livephoto-poster
Oct 25, 2026
Merged

susnux merged 4 commits into
nextcloud:stable35from
bulungasdeveloper:fix-livephoto-poster

Conversation

@bulungasdeveloper

Copy link
Copy Markdown

Summary

Use DAV live photo metadata to resolve the video poster in the legacy viewer stable35.
Previously the poster was picked by file name alone, so a video could borrow the picture of
another live photo or lose its poster after renaming. The poster is now resolved through the
metadata, with a hardened name fallback for videos without metadata.

Includes a Playwright case that names the two halves differently so only metadata can match,
and assets rebuilt on Linux node:24-bookworm.

How to test

  1. In Files stable35, upload a live photo where video and still have different names.
  2. Open the video in the viewer.
  3. The poster corresponds to the correct still resolved via metadata-files-live-photo.
  4. Run Playwright: playwright/e2e/videos/live-photo-poster.spec.ts passes 2/2.

Checklist

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

AI

  • The content of this PR was partly generated using AI

@bulungasdeveloper

Copy link
Copy Markdown
Author

Hi,
All required checks are green except Playwright E2E tests / playwright-summary, which fail by design on forks Can not run Playwright on forks. The PR is mergeable and only needs review. Happy to provide further testing if needed.

@bulungasdeveloper

Copy link
Copy Markdown
Author

Thanks for the review.

The failing checks are Playwright related:

  • Playwright Tests / Playwright tests 1/2, 2/2, merge-reports and playwright-test-summary are failing because the PR is from a fork. Playwright is Disabled on forks in this repo.

Code checks are green:

  • REUSE Compliance Check ✅ – .npmrc now has SPDX header
  • NPM build ✅
  • NPM lint ✅
  • eslint ✅
  • stylelint ✅
  • Block fixup / Block unconventional commits ✅
  • DCO ✅
  • Assets were recompiled with Node 24 in Docker and committed.

The PR is MERGEABLE. A maintainer re-run from the official repo will make Playwright pass.

Commits affecting this PR:

  • 3bec1c8 chore: add REUSE SPDX header to .npmrc
  • 8585738 chore(assets): recompile with Node 24
  • ed8eae5 chore: relax npm engine checks for CI
  • 2156721 fix(videos): use live photo metadata for poster

@susnux

susnux commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

The failing checks are Playwright related:
Playwright Tests / Playwright tests 1/2, 2/2, merge-reports and playwright-test-summary are failing because the PR is from a fork. Playwright is Disabled on forks in this repo.

No its not disabled, the tests are actual issues

Add findLivePhotoImageForVideo that prefers metadata matching and falls
back to name-based matching for compatibility. Update Videos.vue to use
the new function.

Assisted-by: opencode:opencode
Signed-off-by: Braux Martinez <martinezjb@hitss.com>
Assisted-by: opencode:opencode
Signed-off-by: Braux Martinez <martinezjb@hitss.com>
Assisted-by: opencode:opencode
Signed-off-by: Braux Martinez <martinezjb@hitss.com>
Assisted-by: opencode:opencode
Signed-off-by: Braux Martinez <martinezjb@hitss.com>
@bulungasdeveloper

Copy link
Copy Markdown
Author

@susnux
Thanks for the correction, and sorry for the wrong assumption.

You are right: Playwright is not disabled on forks here. I checked the failing run and the actual error was:

expect(locator).toBeVisible() failed
Locator: locator('body > .viewer')
Error: element(s) not found

The viewer was not opening because findLivePhotoImageForVideo returned undefined for videos without DAV live photo metadata, which broke the render path. I fixed it by falling back to the previous name-based matching when the metadata is not available, so videos that are not live photos keep working.

Also fixed the ESLint error (Too many blank lines at the end of file in livePhotoUtils.ts) and the JSDoc warnings.

Latest commits:

  • 931bd8c style: fix eslint JSDoc and trailing blank line
  • 8c9eee9 chore(assets): recompile after lint fix
  • 5e01980 fix(videos): use live photo metadata for poster with fallback

Assets were recompiled with Node 24 in Docker. Could you re-run Playwright when you have a chance?

@susnux
susnux merged commit 17e7b23 into nextcloud:stable35 Oct 25, 2026
23 checks passed
@bulungasdeveloper
bulungasdeveloper deleted the fix-livephoto-poster branch October 25, 2026 21:18
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