radio fix

This commit is contained in:
abs3nt 2023-01-13 09:18:54 -08:00
parent 1acc255c61
commit 850cc63b7c
2 changed files with 2 additions and 1 deletions

View File

@ -643,7 +643,7 @@ func RadioFromPlaylist(ctx *gctx.Context, client *spotify.Client, playlist spoti
if pages != 0 { if pages != 0 {
randomPage = rand.Intn(int(pages-1)) + 1 randomPage = rand.Intn(int(pages-1)) + 1
} }
playlistPage, err := client.GetPlaylistItems(ctx, playlist.ID, spotify.Limit(50), spotify.Offset(randomPage*50)) playlistPage, err := client.GetPlaylistItems(ctx, playlist.ID, spotify.Limit(50), spotify.Offset((randomPage-1)*50))
if err != nil { if err != nil {
return err return err
} }

View File

@ -41,6 +41,7 @@ func HandleAlbumArtist(ctx *gctx.Context, client *spotify.Client, id spotify.ID)
func HandlePlaylistRadio(ctx *gctx.Context, client *spotify.Client, playlist spotify.SimplePlaylist) { func HandlePlaylistRadio(ctx *gctx.Context, client *spotify.Client, playlist spotify.SimplePlaylist) {
err := commands.RadioFromPlaylist(ctx, client, playlist) err := commands.RadioFromPlaylist(ctx, client, playlist)
if err != nil { if err != nil {
fmt.Println("AHHHHHHHHHHHHHHHHHH", err.Error())
return return
} }
} }