Skip to content

feat(search): honest has-preview prop and thumbnails relationship - #3210

Draft
dschmidt wants to merge 20 commits into
feat/search-tika-facetsfrom
feat/search-preview-presence
Draft

feat(search): honest has-preview prop and thumbnails relationship#3210
dschmidt wants to merge 20 commits into
feat/search-tika-facetsfrom
feat/search-preview-presence

Conversation

@dschmidt

@dschmidt dschmidt commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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.

  • Split SupportedMimeTypes into Unconditional/Embedded preview types + HasPreview as the single source of truth (unconditional types follow from the mimetype, embedded types like audio cover art depend on an indexed preview).
  • Index embedded cover-art dimensions as 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).
  • Honest oc:has-preview for audio in search results (new preview field on the search message entity).
  • Graph driveItem listings expose the thumbnails relationship on $expand=thumbnails: small/medium/large thumbnail URLs plus a source thumbnail 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 odata expand-set, and switch reva propfind has-preview to thumbnail.HasPreview.

dschmidt added 7 commits July 30, 2026 17:34
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.
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@dschmidt
dschmidt force-pushed the feat/search-preview-presence branch from 5748d3c to 8d0b8ed Compare July 30, 2026 18:31
@dschmidt dschmidt changed the title feat(search): honest previews and driveItem thumbnails relationship feat(search): honest has-preview and driveItem thumbnails relationship Jul 30, 2026
@dschmidt dschmidt changed the title feat(search): honest has-preview and driveItem thumbnails relationship feat(search): honest has-preview and thumbnails relationship Jul 30, 2026
@dschmidt dschmidt changed the title feat(search): honest has-preview and thumbnails relationship feat(search): honest has-preview prop and thumbnails relationship Jul 31, 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.

1 participant