WIP: use the listenbrainz radio api #54

Draft
a wants to merge 6 commits from listenbrainz into master
Showing only changes of commit 82a92ecc9a - Show all commits

@ -27,7 +27,7 @@ func (c *Commander) GetRecomendationIdsForPrompt(ctx context.Context, prompt str
if err != nil {
return nil, err
}
ids := []spotify.ID{}
isMap := map[spotify.ID]struct{}{}
for _, v := range radioResp.Tracks {
match, err := c.lb.MatchTrack(ctx, &v)
if err != nil {
@ -41,9 +41,13 @@ func (c *Commander) GetRecomendationIdsForPrompt(ctx context.Context, prompt str
if match.SpotifyId == "" {
continue
}
ids = append(ids, spotify.ID(match.SpotifyId))
isMap[spotify.ID(match.SpotifyId)] = struct{}{}
}
return ids, nil
keys := make([]spotify.ID, 0, len(isMap))
for i := range isMap {
keys = append(keys, i)
}
return keys, nil
}
func (c *Commander) RadioFromPrompt(ctx context.Context, prompt string, mode string) error {