diff --git a/api/album_lists.go b/api/album_lists.go index 1fdcaf2c9..8e7646d54 100644 --- a/api/album_lists.go +++ b/api/album_lists.go @@ -91,6 +91,21 @@ func (c *AlbumListController) GetStarred() { c.SendResponse(response) } +func (c *AlbumListController) GetStarred2() { + albums, mediaFiles, err := c.listGen.GetAllStarred() + if err != nil { + beego.Error("Error retrieving starred media:", err) + c.SendError(responses.ErrorGeneric, "Internal Error") + } + + response := c.NewEmpty() + response.Starred2 = &responses.Starred{} + response.Starred2.Album = c.ToAlbums(albums) + response.Starred2.Song = c.ToChildren(mediaFiles) + + c.SendResponse(response) +} + func (c *AlbumListController) GetNowPlaying() { npInfos, err := c.listGen.GetNowPlaying() if err != nil { diff --git a/api/responses/responses.go b/api/responses/responses.go index 080ad1721..f1ecaf358 100644 --- a/api/responses/responses.go +++ b/api/responses/responses.go @@ -21,6 +21,7 @@ type Subsonic struct { Playlist *PlaylistWithSongs `xml:"playlist,omitempty" json:"playlist,omitempty"` SearchResult2 *SearchResult2 `xml:"searchResult2,omitempty" json:"searchResult2,omitempty"` Starred *Starred `xml:"starred,omitempty" json:"starred,omitempty"` + Starred2 *Starred `xml:"starred2,omitempty" json:"starred2,omitempty"` NowPlaying *NowPlaying `xml:"nowPlaying,omitempty" json:"nowPlaying,omitempty"` Song *Child `xml:"song,omitempty" json:"song,omitempty"` diff --git a/conf/router.go b/conf/router.go index 54bb94134..51da7cded 100644 --- a/conf/router.go +++ b/conf/router.go @@ -43,6 +43,7 @@ func mapEndpoints() { beego.NSRouter("/getAlbumList.view", &api.AlbumListController{}, "*:GetAlbumList"), beego.NSRouter("/getAlbumList2.view", &api.AlbumListController{}, "*:GetAlbumList2"), beego.NSRouter("/getStarred.view", &api.AlbumListController{}, "*:GetStarred"), + beego.NSRouter("/getStarred2.view", &api.AlbumListController{}, "*:GetStarred2"), beego.NSRouter("/getNowPlaying.view", &api.AlbumListController{}, "*:GetNowPlaying"), beego.NSRouter("/getPlaylists.view", &api.PlaylistsController{}, "*:GetPlaylists"),