Playlists now have all metadata. Also removed some duplicated code

This commit is contained in:
Deluan 2016-03-21 11:57:04 -04:00
parent 516bd3bddf
commit 3cefc321b8
6 changed files with 23 additions and 55 deletions

View file

@ -84,6 +84,14 @@ func (c *BaseAPIController) SendResponse(response responses.Subsonic) {
}
}
func (c *BaseAPIController) ToChildren(entries engine.Entries) []responses.Child {
children := make([]responses.Child, len(entries))
for i, entry := range entries {
children[i] = c.ToChild(entry)
}
return children
}
func (c *BaseAPIController) ToChild(entry engine.Entry) responses.Child {
n := responses.Child{}
n.Id = entry.Id