Add attempts for default data

This commit is contained in:
Melody Becker 2025-04-05 12:22:00 +02:00
parent c25f27e82e
commit 910717cf01
Signed by: mstar
SSH key fingerprint: SHA256:vkXfS9FG2pVNVfvDrzd1VW9n8VJzqqdKQGljxxX8uK8
4 changed files with 56 additions and 3 deletions

View file

@ -3,6 +3,7 @@ package models
import (
"database/sql"
"git.mstar.dev/mstar/linstrom/config"
"gorm.io/gorm"
)
@ -17,3 +18,17 @@ 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,
}
}