Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/config/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package config

import (
"reflect"
"strings"
)

func findFieldByJSONTag(dest reflect.Value, jsonTag string) (reflect.Value, bool) {
Expand All @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/config/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down