diff --git a/server/ctrlsubsonic/handlers_unimplemented.go b/server/ctrlsubsonic/handlers_unimplemented.go new file mode 100644 index 0000000..eca34f2 --- /dev/null +++ b/server/ctrlsubsonic/handlers_unimplemented.go @@ -0,0 +1,15 @@ +package ctrlsubsonic + +import ( + "net/http" + + "go.senan.xyz/gonic/server/ctrlsubsonic/spec" +) + +func (c *Controller) ServeGetPodcasts(r *http.Request) *spec.Response { + sub := spec.NewResponse() + sub.Podcasts = &spec.Podcasts{ + List: []struct{}{}, + } + return sub +} diff --git a/server/ctrlsubsonic/spec/spec.go b/server/ctrlsubsonic/spec/spec.go index 1263cd1..d3d5c9b 100644 --- a/server/ctrlsubsonic/spec/spec.go +++ b/server/ctrlsubsonic/spec/spec.go @@ -44,6 +44,7 @@ type Response struct { PlayQueue *PlayQueue `xml:"playQueue" json:"playQueue,omitempty"` JukeboxStatus *JukeboxStatus `xml:"jukeboxStatus" json:"jukeboxStatus,omitempty"` JukeboxPlaylist *JukeboxPlaylist `xml:"jukeboxPlaylist" json:"jukeboxPlaylist,omitempty"` + Podcasts *Podcasts `xml:"podcasts" json:"podcasts,omitempty"` } func NewResponse() *Response { @@ -285,3 +286,7 @@ type JukeboxPlaylist struct { List []*TrackChild `xml:"entry,omitempty" json:"entry,omitempty"` JukeboxStatus } + +type Podcasts struct { + List []struct{} `xml:"channel" json:"channel"` +} diff --git a/server/server.go b/server/server.go index 22840b7..78000c8 100644 --- a/server/server.go +++ b/server/server.go @@ -189,6 +189,7 @@ func setupSubsonic(r *mux.Router, ctrl *ctrlsubsonic.Controller) { r.Handle("/getGenres{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetGenres)) r.Handle("/getArtistInfo{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetArtistInfo)) // ** begin unimplemented + r.Handle("/getPodcasts{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetPodcasts)) // middlewares should be run for not found handler // https://github.com/gorilla/mux/issues/416 notFoundHandler := ctrl.H(ctrl.ServeNotFound)