mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 13:07:36 +03:00
Update stats of Smart Playlist when it is created
Also fix loadTracks
This commit is contained in:
parent
2c860edeb5
commit
806b13cf42
5 changed files with 37 additions and 12 deletions
|
@ -58,6 +58,15 @@ var _ = Describe("PlaylistRepository", func() {
|
|||
pls, err := repo.GetWithTracks(plsBest.ID)
|
||||
Expect(err).To(BeNil())
|
||||
Expect(pls.Name).To(Equal(plsBest.Name))
|
||||
Expect(pls.Tracks).To(HaveLen(2))
|
||||
Expect(pls.Tracks[0].ID).To(Equal("1"))
|
||||
Expect(pls.Tracks[0].PlaylistID).To(Equal(plsBest.ID))
|
||||
Expect(pls.Tracks[0].MediaFileID).To(Equal(songDayInALife.ID))
|
||||
Expect(pls.Tracks[0].MediaFile.ID).To(Equal(songDayInALife.ID))
|
||||
Expect(pls.Tracks[1].ID).To(Equal("2"))
|
||||
Expect(pls.Tracks[1].PlaylistID).To(Equal(plsBest.ID))
|
||||
Expect(pls.Tracks[1].MediaFileID).To(Equal(songRadioactivity.ID))
|
||||
Expect(pls.Tracks[1].MediaFile.ID).To(Equal(songRadioactivity.ID))
|
||||
mfs := pls.MediaFiles()
|
||||
Expect(mfs).To(HaveLen(2))
|
||||
Expect(mfs[0].ID).To(Equal(songDayInALife.ID))
|
||||
|
@ -78,9 +87,9 @@ var _ = Describe("PlaylistRepository", func() {
|
|||
Expect(repo.Put(&newPls)).To(BeNil())
|
||||
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"))
|
||||
Expect(saved.Tracks[2].ID).To(Equal("1004"))
|
||||
Expect(saved.Tracks[0].MediaFileID).To(Equal("1004"))
|
||||
Expect(saved.Tracks[1].MediaFileID).To(Equal("1003"))
|
||||
Expect(saved.Tracks[2].MediaFileID).To(Equal("1004"))
|
||||
|
||||
By("returns the newly created playlist")
|
||||
Expect(repo.Exists(newPls.ID)).To(BeTrue())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue