diff --git a/storage-new/models/MediaMetadata.go b/storage-new/models/MediaMetadata.go index 777364a..64d9aab 100644 --- a/storage-new/models/MediaMetadata.go +++ b/storage-new/models/MediaMetadata.go @@ -1,6 +1,7 @@ package models import ( + "database/sql" "time" "gorm.io/gorm" @@ -18,7 +19,8 @@ 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"` - OwnedById string // Account id this media belongs to + // OwnedBy User + OwnedById sql.NullString // Account id this media belongs to Remote bool // whether the attachment is a remote one // Where the media is stored. Url Location string @@ -37,14 +39,3 @@ type MediaMetadata struct { // or embedded data, such as the default duck // For external users, transform them into normal http URIs with a "special" path const DefaultDuckLocationName = "linstrom://default-media" - -var DefaultDuckMedia = MediaMetadata{ - ID: "3b562a45-36b7-4c42-a944-3672f319ff7b", - OwnedById: "", // FIXME: Add default user ID here - Remote: false, - Location: DefaultDuckLocationName, - Type: "image/webp", - Name: "default-duck.webp", - AltText: "a greyscale image of a pidgeon on some smooth surface, likely a liquid. It is captioned with the text \"Duck\"", - Blurred: false, -} diff --git a/storage-new/models/RemoteServer.go b/storage-new/models/RemoteServer.go index 9f5d8e6..457d2c7 100644 --- a/storage-new/models/RemoteServer.go +++ b/storage-new/models/RemoteServer.go @@ -3,7 +3,6 @@ package models import ( "database/sql" - "git.mstar.dev/mstar/linstrom/config" "gorm.io/gorm" ) @@ -18,17 +17,3 @@ type RemoteServer struct { IconId sql.NullString // ID of a media file IsSelf bool // Whether this server is yours truly } - -func BuildDefaultServer() *RemoteServer { - return &RemoteServer{ - Model: gorm.Model{ - ID: 1, - }, - ServerType: ServerSoftwareLinstrom, - Domain: config.GlobalConfig.General.GetFullDomain(), - Name: config.GlobalConfig.Self.ServerDisplayName, - Icon: &DefaultDuckMedia, - IconId: sql.NullString{String: DefaultDuckMedia.ID, Valid: true}, - IsSelf: true, - } -}