Skip to content

feat(search): video facet - #3201

Merged
butonic merged 1 commit into
mainfrom
feat/search-video-facet
Sep 2, 2026
Merged

feat(search): video facet#3201
butonic merged 1 commit into
mainfrom
feat/search-video-facet

Conversation

@dschmidt

@dschmidt dschmidt commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Stacked on #3198 (tika facets).

Adds the video facet (dimensions, duration, codec, audio stream details) to the search index, the search API and the graph driveItem.

Maps what the released Tika 4.0.0 exposes for MP4/MOV: width, height, duration, bitrate (video:bitrate, TIKA-4802), frameRate (video:frame-rate, TIKA-4800), audioSamplesPerSecond, audioBitsPerSample (audio:bits-per-sample), audioChannels (numeric audio:channels, enum fallback). Verified against a live apache/tika:4.0.0-full with a generated MP4; against a Tika that does not emit these keys the facet simply stays empty.

Tika stores the video track dimensions under the same tiff:ImageWidth/tiff:ImageLength keys it uses for images (via Metadata.IMAGE_WIDTH), so image and video would otherwise both match. getImage is now gated on the image/ content type and getVideo on video/, inside the respective facet function, so a file gets exactly one of the two.

Still open: the codec FourCCs. video:fourcc (fourCC) and audio:fourcc (audioFormat) land with Tika 4.1 (TIKA-4838) and are already wired up here; until then both stay empty. The xmpDM:videoCompressor name ("AVC Coding") is no FourCC, so it is deliberately not used as a stand-in.

Needs a separate reva change, not includable here (same as #3200): the WebDAV PROPFIND handler must know the video keys to expose the facet over WebDAV. It lives in vendored reva, so it needs its own reva PR + dependency bump. The required diff:

diff --git a/vendor/github.com/opencloud-eu/reva/v2/internal/http/services/owncloud/ocdav/propfind/propfind.go b/vendor/github.com/opencloud-eu/reva/v2/internal/http/services/owncloud/ocdav/propfind/propfind.go
index d86367a2c5..8e4af07848 100644
--- a/vendor/github.com/opencloud-eu/reva/v2/internal/http/services/owncloud/ocdav/propfind/propfind.go
+++ b/vendor/github.com/opencloud-eu/reva/v2/internal/http/services/owncloud/ocdav/propfind/propfind.go
@@ -107,6 +107,18 @@ var (
 		"orientation",
 		"takenDateTime",
 	}
+	videoKeys = []string{
+		"audioBitsPerSample",
+		"audioChannels",
+		"audioFormat",
+		"audioSamplesPerSecond",
+		"bitrate",
+		"duration",
+		"fourCC",
+		"frameRate",
+		"height",
+		"width",
+	}
 )
 
 type countingReader struct {
@@ -887,6 +899,8 @@ func metadataKeys(pf XML) ([]string, []string) {
 					metadataKeys = append(metadataKeys, metadataKeysWithPrefix("libre.graph.image", imageKeys)...)
 				case "http://owncloud.org/ns/photo":
 					metadataKeys = append(metadataKeys, metadataKeysWithPrefix("libre.graph.photo", photoKeys)...)
+				case "http://owncloud.org/ns/video":
+					metadataKeys = append(metadataKeys, metadataKeysWithPrefix("libre.graph.video", videoKeys)...)
 				default:
 					metadataKeys = append(metadataKeys, key)
 				}
@@ -944,7 +958,7 @@ func requiresExplicitFetching(n *xml.Name) bool {
 		}
 	case net.NsOwncloud:
 		switch n.Local {
-		case "favorite", "share-types", "checksums", "size", "tags", "audio", "location", "image", "photo":
+		case "favorite", "share-types", "checksums", "size", "tags", "audio", "location", "image", "photo", "video":
 			return true
 		default:
 			return false
@@ -1292,6 +1306,7 @@ func mdToPropResponse(ctx context.Context, pf *XML, md *provider.ResourceInfo, p
 			appendMetadataProp(k, "oc", "location", "libre.graph.location", locationKeys)
 			appendMetadataProp(k, "oc", "image", "libre.graph.image", imageKeys)
 			appendMetadataProp(k, "oc", "photo", "libre.graph.photo", photoKeys)
+			appendMetadataProp(k, "oc", "video", "libre.graph.video", videoKeys)
 		}
 
 		if md.Type == provider.ResourceType_RESOURCE_TYPE_CONTAINER {
@@ -1579,6 +1594,10 @@ func mdToPropResponse(ctx context.Context, pf *XML, md *provider.ResourceInfo, p
 					if k := md.GetArbitraryMetadata().GetMetadata(); k != nil {
 						appendMetadataProp(k, "oc", "photo", "libre.graph.photo", photoKeys)
 					}
+				case "video":
+					if k := md.GetArbitraryMetadata().GetMetadata(); k != nil {
+						appendMetadataProp(k, "oc", "video", "libre.graph.video", videoKeys)
+					}
 				case "name":
 					appendToOK(prop.Escaped("oc:name", md.Name))
 				case "shareid":

@codacy-production

codacy-production Bot commented Jul 29, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 1 duplication

Metric Results
Duplication 1

View in Codacy

🟢 Coverage 40.30% diff coverage · +0.04% coverage variation

Metric Results
Coverage variation +0.04% coverage variation (-1.00%)
Diff coverage 40.30% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (f60e2e5) 87708 20427 23.29%
Head commit (727c986) 87901 (+193) 20510 (+83) 23.33% (+0.04%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3201) 201 81 40.30%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

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-video-facet branch 2 times, most recently from 5aa11c6 to 22f66de Compare July 30, 2026 11:41
@dschmidt
dschmidt force-pushed the feat/search-tika-facets branch from c7c0551 to 35231b1 Compare August 18, 2026 16:28
@dschmidt
dschmidt force-pushed the feat/search-video-facet branch from 22f66de to 37d863b Compare August 18, 2026 16:32
@dschmidt
dschmidt force-pushed the feat/search-tika-facets branch 3 times, most recently from 19fb88d to a9c7079 Compare August 31, 2026 17:00
@dschmidt
dschmidt force-pushed the feat/search-video-facet branch 4 times, most recently from 7ce4dbe to 3a1754a Compare August 31, 2026 18:19
@dschmidt
dschmidt marked this pull request as ready for review August 31, 2026 18:19
@dschmidt
dschmidt force-pushed the feat/search-video-facet branch 3 times, most recently from 2954f71 to db5b3f4 Compare August 31, 2026 18:37
@fschade
fschade force-pushed the feat/search-tika-facets branch from 2329c62 to 240239d Compare September 1, 2026 05:17
@dschmidt
dschmidt force-pushed the feat/search-video-facet branch from db5b3f4 to 027b8ac Compare September 1, 2026 05:48
@dschmidt
dschmidt force-pushed the feat/search-tika-facets branch from 240239d to 5e4f124 Compare September 1, 2026 07:10
@dschmidt
dschmidt force-pushed the feat/search-video-facet branch from 027b8ac to 76d98d9 Compare September 1, 2026 07:11
@dschmidt
dschmidt changed the base branch from feat/search-tika-facets to main September 1, 2026 08:31
@dschmidt
dschmidt force-pushed the feat/search-video-facet branch 2 times, most recently from b46290c to b473b6a Compare September 1, 2026 13:30
@dschmidt
dschmidt force-pushed the feat/search-video-facet branch from b473b6a to 727c986 Compare September 1, 2026 14:27
@butonic
butonic merged commit f5a0643 into main Sep 2, 2026
66 of 67 checks passed
@butonic
butonic deleted the feat/search-video-facet branch September 2, 2026 22:20
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