mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-19 13:27:42 +03:00
Return error when no matching cover is found
When checking stored references to cover images (whether embedded or external), it's possible that configured patterns do no match, and a valid error should be returned in those cases.
This commit is contained in:
parent
08cd28af2d
commit
d9c991e325
@ -135,6 +135,7 @@ func (c *cover) getCover(ctx context.Context, path string, size int) (reader io.
|
||||
}
|
||||
}()
|
||||
var data []byte
|
||||
err = errors.New("no matching cover found")
|
||||
for _, p := range strings.Split(conf.Server.CoverArtPriority, ",") {
|
||||
pat := strings.ToLower(strings.TrimSpace(p))
|
||||
if pat == "embedded" {
|
||||
@ -147,7 +148,9 @@ func (c *cover) getCover(ctx context.Context, path string, size int) (reader io.
|
||||
}
|
||||
}
|
||||
|
||||
if err == nil && size > 0 {
|
||||
if err != nil {
|
||||
return
|
||||
} else if size > 0 {
|
||||
data, err = resizeImage(bytes.NewReader(data), size)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user