You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds the Google Motion Photo facet (version, presentationTimestampUs, videoSize) end to end.
reads the Motion Photo XMP that Tika flattens into Camera: keys, covering the current MotionPhoto scheme and the legacy MicroVideo scheme. Per the spec only a marker value of 1 counts, anything else is treated as a still image. The marker is required: without it a picture that merely carries a video would look like a motion photo.
takes videoSize from the video itself, the Content-Length of the document Tika extracted. No XMP container arithmetic.
confirms the video is actually present (a Google Photos share keeps the XMP but strips the appended video) by letting Tika extract it: the facet survives only when the recursive metadata carries an embedded video/* document. Verified against all three cases with a Tika built from TIKA-4869: Emit the video of a motion photo as an embedded document apache/tika#3115: MotionPhoto and MicroVideo both yield the video as a second document, the stripped file yields one document and no facet.
adds the MotionPhoto search proto message + facet, wires it through the bleve and OpenSearch backends and the graph driveItem (@libre.graph.motionPhoto).
One preparatory commit first: getFirstValue now tries multiple metadata keys (Motion Photo vs legacy MicroVideo).
Needs a separate reva change, not includable here: the WebDAV PROPFIND handler must know the motionPhoto 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..f40f4ec082 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,11 @@ var (
"orientation",
"takenDateTime",
}
+ motionPhotoKeys = []string{+ "version",+ "presentationTimestampUs",+ "videoSize",+ }
)
type countingReader struct {
@@ -887,6 +892,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/motionPhoto":+ metadataKeys = append(metadataKeys, metadataKeysWithPrefix("libre.graph.motionPhoto", motionPhotoKeys)...)
default:
metadataKeys = append(metadataKeys, key)
}
@@ -944,7 +951,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", "motionPhoto":
return true
default:
return false
@@ -1292,6 +1299,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", "motionPhoto", "libre.graph.motionPhoto", motionPhotoKeys)
}
if md.Type == provider.ResourceType_RESOURCE_TYPE_CONTAINER {
@@ -1579,6 +1587,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 "motionPhoto":+ if k := md.GetArbitraryMetadata().GetMetadata(); k != nil {+ appendMetadataProp(k, "oc", "motionPhoto", "libre.graph.motionPhoto", motionPhotoKeys)+ }
case "name":
appendToOK(prop.Escaped("oc:name", md.Name))
case "shareid":
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 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.
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
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 (tika facets).
Adds the Google Motion Photo facet (
version,presentationTimestampUs,videoSize) end to end.Camera:keys, covering the current MotionPhoto scheme and the legacy MicroVideo scheme. Per the spec only a marker value of 1 counts, anything else is treated as a still image. The marker is required: without it a picture that merely carries a video would look like a motion photo.videoSizefrom the video itself, theContent-Lengthof the document Tika extracted. No XMP container arithmetic.video/*document. Verified against all three cases with a Tika built from TIKA-4869: Emit the video of a motion photo as an embedded document apache/tika#3115: MotionPhoto and MicroVideo both yield the video as a second document, the stripped file yields one document and no facet.Camera:keys, and TIKA-4869: Emit the video of a motion photo as an embedded document apache/tika#3115 for the extracted video and itsContent-Length. That one is not released yet, so until it ships the facet always stays empty: no released Tika extracts the video.MotionPhotosearch proto message + facet, wires it through the bleve and OpenSearch backends and the graph driveItem (@libre.graph.motionPhoto).One preparatory commit first:
getFirstValuenow tries multiple metadata keys (Motion Photo vs legacy MicroVideo).Needs a separate reva change, not includable here: the WebDAV PROPFIND handler must know the
motionPhotokeys to expose the facet over WebDAV. It lives in vendored reva, so it needs its own reva PR + dependency bump. The required diff: