feat: expose album, song and artist annotations in the RESTful API

This commit is contained in:
Deluan
2020-03-28 19:22:55 -04:00
parent 0e36ed35a3
commit 777231ea79
7 changed files with 47 additions and 16 deletions
+5 -1
View File
@@ -7,6 +7,8 @@ import (
"strings"
"github.com/Masterminds/squirrel"
"github.com/deluan/navidrome/model"
"github.com/deluan/navidrome/utils"
)
func toSqlArgs(rec interface{}) (map[string]interface{}, error) {
@@ -21,7 +23,9 @@ func toSqlArgs(rec interface{}) (map[string]interface{}, error) {
err = json.Unmarshal(b, &m)
r := make(map[string]interface{}, len(m))
for f, v := range m {
r[toSnakeCase(f)] = v
if !utils.StringInSlice(f, model.AnnotationFields) {
r[toSnakeCase(f)] = v
}
}
return r, err
}