✨ add settings
This commit is contained in:
@ -2,6 +2,7 @@ package model
|
||||
|
||||
import (
|
||||
"github.com/Xhofe/alist/conf"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -50,3 +51,14 @@ func GetSettingByKey(key string) (*SettingItem, error) {
|
||||
}
|
||||
return &items, nil
|
||||
}
|
||||
|
||||
func LoadSettings() {
|
||||
textTypes, err := GetSettingByKey("text types")
|
||||
if err == nil {
|
||||
conf.TextTypes = strings.Split(textTypes.Value, ",")
|
||||
}
|
||||
checkParent, err := GetSettingByKey("check parent folder")
|
||||
if err == nil {
|
||||
conf.CheckParent = checkParent.Value == "true"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user