feat(search): honest has-preview prop and thumbnails relationship - #3210
Draft
dschmidt wants to merge 20 commits into
Draft
feat(search): honest has-preview prop and thumbnails relationship#3210dschmidt wants to merge 20 commits into
dschmidt wants to merge 20 commits into
Conversation
Split SupportedMimeTypes into UnconditionalPreviewMimeTypes (preview follows from the mimetype) and EmbeddedPreviewMimeTypes (audio cover art, may be absent); SupportedMimeTypes stays as their union for the generator. Add HasPreview(md) as the single source of truth: unconditional types are always true, embedded types depend on stored oc.preview dimensions.
For embedded-preview mime types (audio cover art), extract the embedded cover's dimensions from Tika's recursive metadata (requires TIKA-4801) and store them as oc.preview.width/height in the search index and arbitrary metadata, routed through the shared facet-to-metadata flattening. Presence of the dimensions is the preview-presence signal consumed by thumbnail.HasPreview.
With embedded resources now surfaced by Tika (cover art via TIKA-4801), the per-meta facet loop let an embedded image overwrite the container's facets: audio files ended up with a bogus image facet (the cover's dimensions) and a wiped audio facet. Take audio/image/photo/location facets from the container entry only; embedded cover dimensions are captured as the preview instead.
getPreview now prefers the embedded image tagged as the front cover (dc:description "Cover (front)") and falls back to the first embedded image, matching the thumbnailer's cover selection so the reported oc.preview dimensions belong to the picture that actually gets rendered.
Add a shared helper that builds the thumbnails relationship from a resource's info, gated on thumbnail.HasPreview so audio without embedded cover art no longer advertises a preview that fails to render. Reported dimensions are aspect-correct (fit into the box) rather than square, with a source thumbnail carrying the native dimensions (audio cover from oc.preview, images from the image facet). Wired into the drive children listings on $expand=thumbnails.
Add a preview facet to the search message entity carrying the embedded preview dimensions, mapped from the index in both engines. The webdav search report now derives oc:has-preview via thumbnail.HasPreviewForMimeType: unconditional types stay true, embedded-preview types (audio) are true only when a cover was indexed, instead of the blanket mimetype match that reported a preview for every audio file.
Not up to standards ⛔
|
dschmidt
force-pushed
the
feat/search-preview-presence
branch
from
July 30, 2026 18:31
5748d3c to
8d0b8ed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #3198. Depends on the audio cover art support from apache/tika#2983 (TIKA-4801) for the audio preview signal.
Makes preview availability honest instead of a blanket mimetype match, and adds the driveItem thumbnails relationship.
SupportedMimeTypesintoUnconditional/Embeddedpreview types +HasPreviewas the single source of truth (unconditional types follow from the mimetype, embedded types like audio cover art depend on an indexed preview).oc.preview(preferring the front cover, matching the thumbnailer). Also fixes facets leaking from embedded resources into the container (audio no longer gets a bogus image facet / wiped audio facet).oc:has-previewfor audio in search results (newpreviewfield on the search message entity).thumbnailsrelationship on$expand=thumbnails: small/medium/large thumbnail URLs plus asourcethumbnail carrying the original dimensions. Per-size dimensions are omitted because the served size depends on the configured resolution set, not knowable at listing time.Follow-ups (kept out to stay focused): consolidate the shared-view thumbnail blocks via a generic
odataexpand-set, and switch reva propfind has-preview tothumbnail.HasPreview.