Lots of work

This commit is contained in:
mStar 2024-05-31 11:54:39 +02:00
parent a2a937791d
commit 3086b0e9b4
28 changed files with 1284 additions and 2 deletions

22
storage/mediaFile.go Normal file
View file

@ -0,0 +1,22 @@
package storage
import (
"time"
"gorm.io/gorm"
)
type MediaFile struct {
ID string `gorm:"primarykey"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
Remote bool // whether the attachment is a remote one
Link string // url if remote attachment, identifier if local
// Whether this media has been cached locally
// Only really used for user and server icons, not attachments
// Reason: Attachments would take way to much space considering that they are often only loaded a few times at most
// And caching a file for those few times would be a waste of storage
// Caching user and server icons locally however should reduce burden on remote servers by quite a bit though
LocallyCached bool
}