mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 21:17:37 +03:00
Reduce number of queries for some playlists operations.
Also allow admins to update/delete playlists from other users in the Subsonic API. Closes #1366
This commit is contained in:
parent
943082ef4e
commit
d200933b68
7 changed files with 26 additions and 38 deletions
|
@ -55,7 +55,7 @@ var _ = Describe("PlaylistRepository", func() {
|
|||
Expect(err).To(MatchError(model.ErrNotFound))
|
||||
})
|
||||
It("returns all tracks", func() {
|
||||
pls, err := repo.Get(plsBest.ID)
|
||||
pls, err := repo.GetWithTracks(plsBest.ID)
|
||||
Expect(err).To(BeNil())
|
||||
Expect(pls.Name).To(Equal(plsBest.Name))
|
||||
Expect(pls.Tracks).To(Equal(model.MediaFiles{
|
||||
|
@ -76,7 +76,7 @@ var _ = Describe("PlaylistRepository", func() {
|
|||
By("adds repeated songs to a playlist and keeps the order")
|
||||
newPls.Tracks = append(newPls.Tracks, model.MediaFile{ID: "1004"})
|
||||
Expect(repo.Put(&newPls)).To(BeNil())
|
||||
saved, _ := repo.Get(newPls.ID)
|
||||
saved, _ := repo.GetWithTracks(newPls.ID)
|
||||
Expect(saved.Tracks).To(HaveLen(3))
|
||||
Expect(saved.Tracks[0].ID).To(Equal("1004"))
|
||||
Expect(saved.Tracks[1].ID).To(Equal("1003"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue