radio fix

This commit is contained in:
jjohnstondev 2023-01-08 19:53:17 -08:00
parent de4c668710
commit c23e246017
1 changed files with 4 additions and 2 deletions

View File

@ -95,7 +95,7 @@ func RadioGivenSong(ctx *gctx.Context, client *spotify.Client, song_id spotify.I
seed := spotify.Seeds{
Tracks: []spotify.ID{song_id},
}
recomendations, err := client.GetRecommendations(ctx, seed, &spotify.TrackAttributes{}, spotify.Limit(100))
recomendations, err := client.GetRecommendations(ctx, seed, &spotify.TrackAttributes{}, spotify.Limit(99))
if err != nil {
return err
}
@ -111,7 +111,9 @@ func RadioGivenSong(ctx *gctx.Context, client *spotify.Client, song_id spotify.I
if err != nil {
return err
}
_, err = client.AddTracksToPlaylist(ctx, radioPlaylist.ID, recomendationIds...)
queue := []spotify.ID{song_id}
queue = append(queue, recomendationIds...)
_, err = client.AddTracksToPlaylist(ctx, radioPlaylist.ID, queue...)
if err != nil {
return err
}