Skip to content

Commit

Permalink
fix: add stub getStarred views to shut up refix
Browse files Browse the repository at this point in the history
  • Loading branch information
sentriz committed Dec 20, 2021
1 parent d9e8bd0 commit 27ac8e1
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/ctrlsubsonic/handlers_by_folder.go
Expand Up @@ -245,3 +245,13 @@ func (c *Controller) ServeSearchTwo(r *http.Request) *spec.Response {
func (c *Controller) ServeGetArtistInfo(r *http.Request) *spec.Response {
return spec.NewResponse()
}

func (c *Controller) ServeGetStarred(r *http.Request) *spec.Response {
sub := spec.NewResponse()
sub.Starred = &spec.Starred{
Artists: []*spec.Directory{},
Albums: []*spec.TrackChild{},
Tracks: []*spec.TrackChild{},
}
return sub
}
10 changes: 10 additions & 0 deletions server/ctrlsubsonic/handlers_by_tags.go
Expand Up @@ -361,3 +361,13 @@ func (c *Controller) ServeGetSongsByGenre(r *http.Request) *spec.Response {
}
return sub
}

func (c *Controller) ServeGetStarredTwo(r *http.Request) *spec.Response {
sub := spec.NewResponse()
sub.StarredTwo = &spec.StarredTwo{
Artists: []*spec.Artist{},
Albums: []*spec.Album{},
Tracks: []*spec.TrackChild{},
}
return sub
}
14 changes: 14 additions & 0 deletions server/ctrlsubsonic/spec/spec.go
Expand Up @@ -45,6 +45,8 @@ type Response struct {
JukeboxPlaylist *JukeboxPlaylist `xml:"jukeboxPlaylist" json:"jukeboxPlaylist,omitempty"`
Podcasts *Podcasts `xml:"podcasts" json:"podcasts,omitempty"`
Bookmarks *Bookmarks `xml:"bookmarks" json:"bookmarks,omitempty"`
Starred *Starred `xml:"starred" json:"starred,omitempty"`
StarredTwo *StarredTwo `xml:"starred2" json:"starred2,omitempty"`
}

func NewResponse() *Response {
Expand Down Expand Up @@ -338,3 +340,15 @@ type BookmarkEntry struct {
ID *specid.ID `xml:"id,attr" json:"id"`
Type string `xml:"type,attr" json:"type"`
}

type Starred struct {
Artists []*Directory `xml:"artist,omitempty" json:"artist,omitempty"`
Albums []*TrackChild `xml:"album,omitempty" json:"album,omitempty"`
Tracks []*TrackChild `xml:"song,omitempty" json:"song,omitempty"`
}

type StarredTwo struct {
Artists []*Artist `xml:"artist,omitempty" json:"artist,omitempty"`
Albums []*Album `xml:"album,omitempty" json:"album,omitempty"`
Tracks []*TrackChild `xml:"song,omitempty" json:"song,omitempty"`
}
2 changes: 2 additions & 0 deletions server/server.go
Expand Up @@ -230,6 +230,7 @@ func setupSubsonic(r *mux.Router, ctrl *ctrlsubsonic.Controller) {
r.Handle("/getArtists{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetArtists))
r.Handle("/search3{_:(?:\\.view)?}", ctrl.H(ctrl.ServeSearchThree))
r.Handle("/getArtistInfo2{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetArtistInfoTwo))
r.Handle("/getStarred2{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetStarredTwo))

// browse by folder
r.Handle("/getIndexes{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetIndexes))
Expand All @@ -238,6 +239,7 @@ func setupSubsonic(r *mux.Router, ctrl *ctrlsubsonic.Controller) {
r.Handle("/search2{_:(?:\\.view)?}", ctrl.H(ctrl.ServeSearchTwo))
r.Handle("/getGenres{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetGenres))
r.Handle("/getArtistInfo{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetArtistInfo))
r.Handle("/getStarred{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetStarred))

// podcasts
r.Handle("/getPodcasts{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetPodcasts))
Expand Down

0 comments on commit 27ac8e1

Please sign in to comment.