fix: if a field changed, set its changes
This commit is contained in:
parent
8d20659a5b
commit
35b64515d7
|
@ -93,22 +93,27 @@ func (m *MetadataServiceDefault) SaveUpload(ctx context.Context, metadata Upload
|
||||||
changed := false
|
changed := false
|
||||||
|
|
||||||
if upload.UserID != metadata.UserID {
|
if upload.UserID != metadata.UserID {
|
||||||
|
upload.UserID = metadata.UserID
|
||||||
changed = true
|
changed = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if upload.MimeType != metadata.MimeType {
|
if upload.MimeType != metadata.MimeType {
|
||||||
|
upload.MimeType = metadata.MimeType
|
||||||
changed = true
|
changed = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if upload.Protocol != metadata.Protocol {
|
if upload.Protocol != metadata.Protocol {
|
||||||
|
upload.Protocol = metadata.Protocol
|
||||||
changed = true
|
changed = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if upload.UploaderIP != metadata.UploaderIP {
|
if upload.UploaderIP != metadata.UploaderIP {
|
||||||
|
upload.UploaderIP = metadata.UploaderIP
|
||||||
changed = true
|
changed = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if upload.Size != metadata.Size {
|
if upload.Size != metadata.Size {
|
||||||
|
upload.Size = metadata.Size
|
||||||
changed = true
|
changed = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue