navidrome/server/public/handle_downloads.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
377 B
Go
Raw Normal View History

2023-03-11 02:46:13 +01:00
package public
import (
"net/http"
"github.com/navidrome/navidrome/utils/req"
2023-03-11 02:46:13 +01:00
)
func (pub *Router) handleDownloads(w http.ResponseWriter, r *http.Request) {
id, err := req.Params(r).String(":id")
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
2023-03-11 02:46:13 +01:00
return
}
err = pub.archiver.ZipShare(r.Context(), id, w)
2023-03-11 02:46:13 +01:00
checkShareError(r.Context(), w, err, id)
}