add dummy getPodcasts view

fixes #98
This commit is contained in:
sentriz
2021-01-02 16:06:59 +00:00
parent f981ddef91
commit 75fce9e214
3 changed files with 21 additions and 0 deletions

View File

@@ -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
}

View File

@@ -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"`
}

View File

@@ -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)