Return 404 when artwork is not available in /share/img endpoint
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"net/http/httptest"
|
||||
"time"
|
||||
|
||||
"github.com/navidrome/navidrome/core/artwork"
|
||||
"github.com/navidrome/navidrome/log"
|
||||
"github.com/navidrome/navidrome/model"
|
||||
"github.com/navidrome/navidrome/tests"
|
||||
@@ -105,13 +106,14 @@ var _ = Describe("MediaRetrievalController", func() {
|
||||
})
|
||||
|
||||
type fakeArtwork struct {
|
||||
artwork.Artwork
|
||||
data string
|
||||
err error
|
||||
recvId string
|
||||
recvSize int
|
||||
}
|
||||
|
||||
func (c *fakeArtwork) Get(_ context.Context, id string, size int) (io.ReadCloser, time.Time, error) {
|
||||
func (c *fakeArtwork) GetOrPlaceholder(_ context.Context, id string, size int) (io.ReadCloser, time.Time, error) {
|
||||
if c.err != nil {
|
||||
return nil, time.Time{}, c.err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user