mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-26 08:22:17 +03:00
Now lists all artists for a given genre
This commit is contained in:
parent
0ff8cbfd17
commit
9078ed7642
@ -185,8 +185,18 @@ func (cds *contentDirectoryService) readContainer(o object, host string) (ret []
|
|||||||
} else if matchResults["GenreArtist"] != "" {
|
} else if matchResults["GenreArtist"] != "" {
|
||||||
log.Debug("TODO GenreArtist MATCH")
|
log.Debug("TODO GenreArtist MATCH")
|
||||||
} else if matchResults["Genre"] != "" {
|
} else if matchResults["Genre"] != "" {
|
||||||
//x, xerr := cds.ds.Album(cds.ctx).GetAll(model.QueryOptions{Filters: squirrel.Eq{}})
|
artists, err := cds.ds.Artist(cds.ctx).GetAll(model.QueryOptions{Filters: squirrel.Eq{ "genre.id": matchResults["Genre"]}})
|
||||||
log.Debug("TODO Get albums for Genre X")
|
if err != nil {
|
||||||
|
fmt.Printf("Error retrieving artists for genre: %+v", err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
for artistIndex := range artists {
|
||||||
|
child := object{
|
||||||
|
Path: path.Join(o.Path, artists[artistIndex].Name),
|
||||||
|
Id: path.Join(o.Path, artists[artistIndex].ID),
|
||||||
|
}
|
||||||
|
ret = append(ret, cds.cdsObjectToUpnpavObject(child, true, host))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
indexes, err := cds.ds.Genre(cds.ctx).GetAll()
|
indexes, err := cds.ds.Genre(cds.ctx).GetAll()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user