diff --git a/server/ctrlsubsonic/handlers_playlist.go b/server/ctrlsubsonic/handlers_playlist.go index 89f1b18..2d74f7f 100644 --- a/server/ctrlsubsonic/handlers_playlist.go +++ b/server/ctrlsubsonic/handlers_playlist.go @@ -16,9 +16,13 @@ func playlistRender(c *Controller, playlist *db.Playlist) *spec.Playlist { user := &db.User{} c.DB.Where("id=?", playlist.UserID).Find(user) // - resp := spec.NewPlaylist(playlist) - resp.Owner = user.Name - resp.SongCount = playlist.TrackCount + resp := &spec.Playlist{ + ID: playlist.ID, + Name: playlist.Name, + Comment: playlist.Comment, + Created: playlist.CreatedAt, + SongCount: playlist.TrackCount, + } // trackIDs := playlist.GetItems() resp.List = make([]*spec.TrackChild, len(trackIDs)) diff --git a/server/ctrlsubsonic/spec/construct.go b/server/ctrlsubsonic/spec/construct.go deleted file mode 100644 index c8ebd24..0000000 --- a/server/ctrlsubsonic/spec/construct.go +++ /dev/null @@ -1,16 +0,0 @@ -package spec - -import ( - "go.senan.xyz/gonic/server/db" -) - -func NewPlaylist(p *db.Playlist) *Playlist { - return &Playlist{ - ID: p.ID, - Name: p.Name, - Comment: p.Comment, - Duration: 1, - Public: true, - Created: p.CreatedAt, - } -}