finish setup data insertion, add world insertion

This commit is contained in:
lbenedar
2026-04-22 18:18:43 +03:00
parent 21abe68858
commit f46ff8333e
66 changed files with 2257 additions and 676 deletions

View File

@@ -17,24 +17,28 @@ type Macro struct {
// Flags any `json:"flags,omitempty"`
}
func (m *Macro) ToDB(dest *db.Macro) bool {
func (m *Macro) ToDB(dest **db.Macro) bool {
if dest == nil {
return false
}
dest.Command = m.Command
dest.Name = m.Name
dest.Type = m.Type
dest.Img = m.Img
dest.ID = m.ID
dest.Author = m.Author
dest.Scope = m.Scope
dest.Folder = m.Folder
dest.Sort = m.Sort
macro := &db.Macro{
Command: m.Command,
Name: m.Name,
Type: m.Type,
Img: m.Img,
ID: m.ID,
Author: m.Author,
Scope: m.Scope,
Folder: m.Folder,
Sort: m.Sort,
}
m.Stats.ToDB(&dest.Stats)
m.Stats.ToDB(&macro.Stats)
OwnershipToDB(&dest.Ownership, m.Ownership)
OwnershipToDB(&macro.Ownership, m.Ownership)
*dest = macro
return true
}