diff --git a/cmd/dwellin-radiodj/main.go b/cmd/dwellin-radiodj/main.go index 8757c9c..ff263f7 100644 --- a/cmd/dwellin-radiodj/main.go +++ b/cmd/dwellin-radiodj/main.go @@ -38,8 +38,12 @@ func main() { r := httpr.New() 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.Handler(http.MethodGet, "/", djh.ListenersGet) @@ -47,7 +51,7 @@ func main() { s.Handler(http.MethodDelete, "/", djh.ListenersDec) s = r.Sub("/playlist") - s.Handler(http.MethodGet, "/", http.NotFound) + s.Handler(http.MethodGet, "/", djh.PlaylistNext) s = r.Sub("/song") s.Handler(http.MethodGet, "/", http.NotFound)