diff --git a/server/ctrlsubsonic/handlers_common.go b/server/ctrlsubsonic/handlers_common.go index a1d1d86..b2f03fe 100644 --- a/server/ctrlsubsonic/handlers_common.go +++ b/server/ctrlsubsonic/handlers_common.go @@ -407,3 +407,9 @@ func (c *Controller) ServeJukebox(r *http.Request) *spec.Response { // nolint:go sub.JukeboxStatus = status return sub } + +func (c *Controller) ServeGetLyrics(r *http.Request) *spec.Response { + sub := spec.NewResponse() + sub.Lyrics = &spec.Lyrics{} + return sub +} diff --git a/server/ctrlsubsonic/spec/spec.go b/server/ctrlsubsonic/spec/spec.go index bb3268e..82faf7b 100644 --- a/server/ctrlsubsonic/spec/spec.go +++ b/server/ctrlsubsonic/spec/spec.go @@ -58,6 +58,7 @@ type Response struct { SimilarSongs *SimilarSongs `xml:"similarSongs" json:"similarSongs,omitempty"` SimilarSongsTwo *SimilarSongsTwo `xml:"similarSongs2" json:"similarSongs2,omitempty"` InternetRadioStations *InternetRadioStations `xml:"internetRadioStations" json:"internetRadioStations,omitempty"` + Lyrics *Lyrics `xml:"lyrics" json:"lyrics,omitempty"` } func NewResponse() *Response { @@ -409,6 +410,12 @@ type InternetRadioStation struct { HomepageURL string `xml:"homepageUrl,attr" json:"homepageUrl"` } +type Lyrics struct { + Value string `xml:",chardata" json:"value,omitempty"` + Artist string `xml:"artist,attr,omitempty" json:"artist,omitempty"` + Title string `xml:"title,attr,omitempty" json:"title,omitempty"` +} + func formatRating(rating float64) string { if rating == 0 { return "" diff --git a/server/server.go b/server/server.go index 5786583..7dd5a58 100644 --- a/server/server.go +++ b/server/server.go @@ -236,6 +236,7 @@ func setupSubsonic(r *mux.Router, ctrl *ctrlsubsonic.Controller) { r.Handle("/getTopSongs{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetTopSongs)) r.Handle("/getSimilarSongs{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetSimilarSongs)) r.Handle("/getSimilarSongs2{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetSimilarSongsTwo)) + r.Handle("/getLyrics{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetLyrics)) // raw r.Handle("/getCoverArt{_:(?:\\.view)?}", ctrl.HR(ctrl.ServeGetCoverArt))