diff --git a/app/config/internal.go b/app/config/internal.go index d688b79..5cbe705 100644 --- a/app/config/internal.go +++ b/app/config/internal.go @@ -2,6 +2,7 @@ package config import ( "reflect" + "strings" ) func findFieldByJSONTag(dest reflect.Value, jsonTag string) (reflect.Value, bool) { @@ -10,7 +11,11 @@ func findFieldByJSONTag(dest reflect.Value, jsonTag string) (reflect.Value, bool field := dest.Field(i) fieldType := destType.Field(i) tag := fieldType.Tag.Get("json") - if tag == jsonTag { + name := strings.SplitN(tag, ",", 2)[0] + if name == "" || name == "-" { + continue + } + if name == jsonTag { return field, true } } diff --git a/app/config/structs.go b/app/config/structs.go index 38f84e2..e1ffcea 100644 --- a/app/config/structs.go +++ b/app/config/structs.go @@ -34,7 +34,7 @@ type AudioCacheSettings struct { type ServerSettings struct { Auth AuthSettings `json:"auth,omitempty"` - Engines ServerSettingsEngines `json:"engines, omitempty"` + Engines ServerSettingsEngines `json:"engines,omitempty"` } type ServerSettingsEngines struct { Piper map[string]ModelInstances `json:"piper,omitempty"`