mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 21:17:37 +03:00
Initial work on Shares
This commit is contained in:
parent
5331de17c2
commit
ab04e33da6
36 changed files with 841 additions and 84 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/navidrome/navidrome/core"
|
||||
"github.com/navidrome/navidrome/core/artwork"
|
||||
"github.com/navidrome/navidrome/log"
|
||||
"github.com/navidrome/navidrome/model"
|
||||
|
@ -17,11 +18,12 @@ import (
|
|||
|
||||
type Router struct {
|
||||
http.Handler
|
||||
artwork artwork.Artwork
|
||||
artwork artwork.Artwork
|
||||
streamer core.MediaStreamer
|
||||
}
|
||||
|
||||
func New(artwork artwork.Artwork) *Router {
|
||||
p := &Router{artwork: artwork}
|
||||
func New(artwork artwork.Artwork, streamer core.MediaStreamer) *Router {
|
||||
p := &Router{artwork: artwork, streamer: streamer}
|
||||
p.Handler = p.routes()
|
||||
|
||||
return p
|
||||
|
@ -32,6 +34,7 @@ func (p *Router) routes() http.Handler {
|
|||
|
||||
r.Group(func(r chi.Router) {
|
||||
r.Use(server.URLParamsMiddleware)
|
||||
r.HandleFunc("/s/{id}", p.handleStream)
|
||||
r.HandleFunc("/img/{id}", p.handleImages)
|
||||
})
|
||||
return r
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue