mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 13:07:36 +03:00
Remove tracks from Playlist's GetAll
This commit is contained in:
parent
ab690215ef
commit
5682d0e721
2 changed files with 1 additions and 15 deletions
|
@ -14,7 +14,7 @@ type Playlist struct {
|
|||
SongCount int `json:"songCount"`
|
||||
Owner string `json:"owner"`
|
||||
Public bool `json:"public"`
|
||||
Tracks MediaFiles `json:"tracks"`
|
||||
Tracks MediaFiles `json:"tracks,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
|
|
@ -74,11 +74,6 @@ func (r *playlistRepository) GetAll(options ...model.QueryOptions) (model.Playli
|
|||
sel := r.newSelect(options...).Columns("*")
|
||||
var res model.Playlists
|
||||
err := r.queryAll(sel, &res)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// TODO Maybe the tracks are not required when retrieving all playlists?
|
||||
err = r.loadAllTracks(res)
|
||||
return res, err
|
||||
}
|
||||
|
||||
|
@ -128,15 +123,6 @@ func (r *playlistRepository) updateTracks(id string, tracks model.MediaFiles) er
|
|||
return err
|
||||
}
|
||||
|
||||
func (r *playlistRepository) loadAllTracks(all model.Playlists) error {
|
||||
for i := range all {
|
||||
if err := r.loadTracks(&all[i]); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *playlistRepository) loadTracks(pls *model.Playlist) (err error) {
|
||||
tracksQuery := Select().From("playlist_tracks").
|
||||
LeftJoin("annotation on ("+
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue