Extend media metadata to include ownership
This commit is contained in:
parent
54ccbaa96e
commit
c01b851fbf
1 changed files with 5 additions and 1 deletions
|
@ -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
|
// 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
|
// If not null, this entry is marked as deleted
|
||||||
DeletedAt gorm.DeletedAt `gorm:"index"`
|
DeletedAt gorm.DeletedAt `gorm:"index"`
|
||||||
|
OwnedBy string // Account id this media belongs to
|
||||||
Remote bool // whether the attachment is a remote one
|
Remote bool // whether the attachment is a remote one
|
||||||
// Where the media is stored. Url if remote file, file path if local
|
// Where the media is stored. Url if remote file, file path if local
|
||||||
Location string
|
Location string
|
||||||
|
@ -32,9 +33,12 @@ type MediaMetadata struct {
|
||||||
Blurred bool
|
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))
|
defer util.Untrace(util.Trace(&log.Logger))
|
||||||
newMedia := MediaMetadata{
|
newMedia := MediaMetadata{
|
||||||
|
OwnedBy: ownerId,
|
||||||
Location: location,
|
Location: location,
|
||||||
Name: name,
|
Name: name,
|
||||||
Type: mediaType,
|
Type: mediaType,
|
||||||
|
|
Loading…
Reference in a new issue