mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-12 05:08:12 +08:00
fix bug/webinfo-add custom template
This commit is contained in:
@@ -19,13 +19,14 @@ type TemplateStore struct {
|
||||
|
||||
func newTemplateStore(filename string) *TemplateStore {
|
||||
s := &TemplateStore{Templates: map[string]*WebTemplate{}}
|
||||
var templates []WebTemplate
|
||||
var templates []*WebTemplate
|
||||
file, err := ioutil.ReadFile(filename)
|
||||
if err == nil {
|
||||
_ = json.Unmarshal(file, &templates)
|
||||
}
|
||||
|
||||
for _, tmpl := range templates {
|
||||
s.Templates[tmpl.Name] = &tmpl
|
||||
s.Templates[tmpl.Name] = tmpl
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user