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
+7 -3
View File
@@ -41,9 +41,13 @@ type artwork struct {
}
func (a *artwork) Get(ctx context.Context, id string, size int) (io.ReadCloser, error) {
artID, err := model.ParseArtworkID(id)
if err != nil {
return nil, errors.New("invalid ID")
var artID model.ArtworkID
var err error
if id != "" {
artID, err = model.ParseArtworkID(id)
if err != nil {
return nil, errors.New("invalid ID")
}
}
key := &artworkKey{a: a, artID: artID, size: size}