diff --git a/storage/mediaFile.go b/storage/mediaFile.go index 2c475e0..e2c6843 100644 --- a/storage/mediaFile.go +++ b/storage/mediaFile.go @@ -19,6 +19,7 @@ type MediaMetadata struct { // Soft delete means that this entry still exists in the db, but gorm won't include it anymore unless specifically told to // If not null, this entry is marked as deleted DeletedAt gorm.DeletedAt `gorm:"index"` + OwnedBy string // Account id this media belongs to Remote bool // whether the attachment is a remote one // Where the media is stored. Url if remote file, file path if local Location string @@ -32,9 +33,12 @@ type MediaMetadata struct { Blurred bool } -func (s *Storage) NewMediaMetadata(location, mediaType, name string) (*MediaMetadata, error) { +func (s *Storage) NewMediaMetadata( + ownerId, location, mediaType, name string, +) (*MediaMetadata, error) { defer util.Untrace(util.Trace(&log.Logger)) newMedia := MediaMetadata{ + OwnedBy: ownerId, Location: location, Name: name, Type: mediaType,