Handle empty cover art ID in subsonic API

This commit is contained in:
Deluan
2022-12-20 11:34:01 -05:00
committed by Deluan Quintão
parent 0da27e8a3f
commit abd3274250
3 changed files with 16 additions and 4 deletions
+8
View File
@@ -41,6 +41,14 @@ var _ = Describe("Artwork", func() {
aw = NewArtwork(ds, cache).(*artwork)
})
Context("Empty ID", func() {
It("returns placeholder if album is not in the DB", func() {
_, path, err := aw.get(context.Background(), model.ArtworkID{}, 0)
Expect(err).ToNot(HaveOccurred())
Expect(path).To(Equal(consts.PlaceholderAlbumArt))
})
})
Context("Albums", func() {
Context("ID not found", func() {
It("returns placeholder if album is not in the DB", func() {