mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
getStarred2.view implemented
This commit is contained in:
parent
615dc862af
commit
a562bfd17e
3 changed files with 17 additions and 0 deletions
|
@ -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 {
|
||||
|
|
|
@ -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"`
|
||||
|
||||
|
|
|
@ -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"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue