mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-24 10:59:47 +01:00
Reimplemented GetAlbumList&type=random and GetRandomSongs (now with filter by genres)
This commit is contained in:
parent
6cd758faa0
commit
de0816da67
9 changed files with 80 additions and 54 deletions
|
|
@ -132,8 +132,9 @@ func (c *AlbumListController) GetNowPlaying(w http.ResponseWriter, r *http.Reque
|
|||
|
||||
func (c *AlbumListController) GetRandomSongs(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error) {
|
||||
size := utils.MinInt(ParamInt(r, "size", 10), 500)
|
||||
genre := ParamString(r, "genre")
|
||||
|
||||
songs, err := c.listGen.GetRandomSongs(size)
|
||||
songs, err := c.listGen.GetRandomSongs(size, genre)
|
||||
if err != nil {
|
||||
log.Error(r, "Error retrieving random songs", "error", err)
|
||||
return nil, NewError(responses.ErrorGeneric, "Internal Error")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue