Outputting a track object with metadata, we should use the trackid in the ID rather

than the title
This commit is contained in:
Rob Emery 2025-02-02 17:13:01 +00:00
parent e8301cf864
commit 8c89957826

View File

@ -192,7 +192,8 @@ func (cds *contentDirectoryService) readContainer(o object, host string) (ret []
fmt.Printf("Error retrieving tracks for artist and genre: %+v", err) fmt.Printf("Error retrieving tracks for artist and genre: %+v", err)
return nil, err return nil, err
} }
return cds.doMediaFiles(tracks, o.Path, ret, host)
/*
//TODO do the metadata and stuff here //TODO do the metadata and stuff here
for trackIndex := range tracks { for trackIndex := range tracks {
child := object { child := object {
@ -200,7 +201,7 @@ func (cds *contentDirectoryService) readContainer(o object, host string) (ret []
Id: path.Join(o.Path, tracks[trackIndex].ID), Id: path.Join(o.Path, tracks[trackIndex].ID),
} }
ret = append(ret, cds.cdsObjectToUpnpavObject(child, false, host)) ret = append(ret, cds.cdsObjectToUpnpavObject(child, false, host))
} }*/
} else if matchResults["Genre"] != "" { } else if matchResults["Genre"] != "" {
if matchResults["GenreArtist"] == "" { if matchResults["GenreArtist"] == "" {
artists, err := cds.ds.Artist(cds.ctx).GetAll(model.QueryOptions{Filters: squirrel.Eq{ "genre.id": matchResults["Genre"]}}) artists, err := cds.ds.Artist(cds.ctx).GetAll(model.QueryOptions{Filters: squirrel.Eq{ "genre.id": matchResults["Genre"]}})
@ -281,7 +282,7 @@ func (cds *contentDirectoryService) doMediaFiles(tracks model.MediaFiles, basePa
*/ */
for _, track := range tracks { for _, track := range tracks {
child := object{ child := object{
Path: path.Join(basePath, track.Title), Path: path.Join(basePath, track.ID),
Id: path.Join(basePath, track.ID), Id: path.Join(basePath, track.ID),
} }
title := track.Title title := track.Title