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

feat(server): Handle sidecars in external libraries #14800

Merged
merged 2 commits into from
Dec 22, 2024

Conversation

etnoy
Copy link
Contributor

@etnoy etnoy commented Dec 19, 2024

Recent improvements in sidecar handling in uploaded assets haven't propagated to external libraries before now.

With this PR, we correctly handle both file.jpg.xmp and file.xmp.

The key part is that we force a sidecar update for every metadata extraction of an external asset.

e2e tests added

A limitation that remains is that we don't automatically import changes when only the xmp is changed. The user will have to manually initiate a metadata refresh of the affected assets when this happens. This will be handled in the future by the planned asset file handling rework, but this depends on the kysely migration :) With the new asset file rework we will only re-discover xmp files when we actually need to.

This PR is a prerequisite for #14456

@etnoy etnoy force-pushed the fix/external-library-sidecars branch from 7af5081 to d0bb59f Compare December 19, 2024 14:01
@etnoy etnoy force-pushed the fix/external-library-sidecars branch 7 times, most recently from 400e4e0 to a542e87 Compare December 19, 2024 23:14
@etnoy etnoy force-pushed the fix/external-library-sidecars branch from a542e87 to 8868d38 Compare December 20, 2024 00:05
Copy link
Contributor

@alextran1502 alextran1502 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we currently handle this mechanism before this change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you help explain the logic changes in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the library service I now queue a sidecar discovery job when an asset is updated. That job will queue a metadata extraction if the sidcar discovery suceeds or skips, not if it fails. Therefore, if it was successful in finding a change in sidecar info, it will perform a metadata extraction and not skip that step.

@etnoy
Copy link
Contributor Author

etnoy commented Dec 21, 2024

How do we currently handle this mechanism before this change?

Badly and it was very broken. Only file.jpg.xmp was picked up in an external library, not file.jpg. Also, it was impossible to refresh a sidecar of any given asset without running the sidecar discovery job for all assets in the db.

In this PR, external assets are handled exactly like normal assets without duplicating code.

@alextran1502 alextran1502 merged commit 4bc2aa5 into main Dec 22, 2024
36 checks passed
@alextran1502 alextran1502 deleted the fix/external-library-sidecars branch December 22, 2024 02:50
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.

2 participants