From 35b64515d767f38913247d58c69893adfc87348e Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 22 Mar 2024 19:35:11 -0400 Subject: [PATCH] fix: if a field changed, set its changes --- metadata/metadata.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/metadata/metadata.go b/metadata/metadata.go index da18888..958697f 100644 --- a/metadata/metadata.go +++ b/metadata/metadata.go @@ -93,22 +93,27 @@ func (m *MetadataServiceDefault) SaveUpload(ctx context.Context, metadata Upload changed := false if upload.UserID != metadata.UserID { + upload.UserID = metadata.UserID changed = true } if upload.MimeType != metadata.MimeType { + upload.MimeType = metadata.MimeType changed = true } if upload.Protocol != metadata.Protocol { + upload.Protocol = metadata.Protocol changed = true } if upload.UploaderIP != metadata.UploaderIP { + upload.UploaderIP = metadata.UploaderIP changed = true } if upload.Size != metadata.Size { + upload.Size = metadata.Size changed = true }