Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix: Write hash for live photo

Neeraj Gupta94f2d5953ff1
diff --git a/pkg/model/remote.go b/pkg/model/remote.go
index 75ff88c430..d8d6f3fcee 100644
--- a/pkg/model/remote.go
+++ b/pkg/model/remote.go
@@ -87,6 +87,14 @@ func (r *RemoteFile) IsLivePhoto() bool {
func (r *RemoteFile) GetFileHash() *string {
value, ok := r.Metadata["hash"]
if !ok {
+ if r.IsLivePhoto() {
+ imageHash, hasImgHash := r.Metadata["imageHash"]
+ vidHash, hasVidHash := r.Metadata["videoHash"]
+ if hasImgHash && hasVidHash {
+ hash := fmt.Sprintf("%s:%s", imageHash, vidHash)
+ return &hash
+ }
+ }
return nil
}
if str, ok := value.(string); ok {