Add attempts for default data
This commit is contained in:
parent
c25f27e82e
commit
910717cf01
4 changed files with 56 additions and 3 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue