Added a playlist instance and pass a PlaylistNext handler.
This commit is contained in:
parent
88b5f21343
commit
ca33de09cc
@ -38,8 +38,12 @@ func main() {
|
|||||||
r := httpr.New()
|
r := httpr.New()
|
||||||
|
|
||||||
lstnrs := radio.NewListeners()
|
lstnrs := radio.NewListeners()
|
||||||
|
plylst, err := radio.NewPlaylist(*playlist, true)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalln(err)
|
||||||
|
}
|
||||||
|
|
||||||
djh := ihttp.NewDJHandlers(lstnrs)
|
djh := ihttp.NewDJHandlers(lstnrs, plylst)
|
||||||
|
|
||||||
s := r.Sub("/listener")
|
s := r.Sub("/listener")
|
||||||
s.Handler(http.MethodGet, "/", djh.ListenersGet)
|
s.Handler(http.MethodGet, "/", djh.ListenersGet)
|
||||||
@ -47,7 +51,7 @@ func main() {
|
|||||||
s.Handler(http.MethodDelete, "/", djh.ListenersDec)
|
s.Handler(http.MethodDelete, "/", djh.ListenersDec)
|
||||||
|
|
||||||
s = r.Sub("/playlist")
|
s = r.Sub("/playlist")
|
||||||
s.Handler(http.MethodGet, "/", http.NotFound)
|
s.Handler(http.MethodGet, "/", djh.PlaylistNext)
|
||||||
|
|
||||||
s = r.Sub("/song")
|
s = r.Sub("/song")
|
||||||
s.Handler(http.MethodGet, "/", http.NotFound)
|
s.Handler(http.MethodGet, "/", http.NotFound)
|
||||||
|
Loading…
Reference in New Issue
Block a user