mirror of https://github.com/synctv-org/synctv
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
473 B
Go
31 lines
473 B
Go
package op
|
|
|
|
import (
|
|
"github.com/bluele/gcache"
|
|
"github.com/synctv-org/synctv/internal/db"
|
|
"github.com/synctv-org/synctv/internal/model"
|
|
)
|
|
|
|
func Init(size int) error {
|
|
userCache = gcache.New(size).
|
|
LRU().
|
|
Build()
|
|
|
|
si, err := db.GetSettingItems()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
for _, si2 := range si {
|
|
switch si2.Type {
|
|
case model.SettingTypeBool:
|
|
b, ok := boolSettings[si2.Name]
|
|
if ok {
|
|
b.value = si2.Value
|
|
}
|
|
}
|
|
}
|
|
cleanReg()
|
|
|
|
return nil
|
|
}
|