fix(server): add logs to public image endpoint

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan 2025-01-15 08:47:47 -05:00 committed by Joe Stump
parent 72348f2b05
commit d8df06f9f1
No known key found for this signature in database
GPG Key ID: 29151C3EC48A0EB9

View File

@ -25,12 +25,14 @@ func (pub *Router) handleImages(w http.ResponseWriter, r *http.Request) {
p := req.Params(r)
id, _ := p.String(":id")
if id == "" {
log.Warn(r, "No id provided")
http.Error(w, "invalid id", http.StatusBadRequest)
return
}
artId, err := decodeArtworkID(id)
if err != nil {
log.Error(r, "Error decoding artwork id", "id", id, err)
http.Error(w, err.Error(), http.StatusBadRequest)
return
}