Skip to content

Commit

Permalink
yay
Browse files Browse the repository at this point in the history
  • Loading branch information
ThinLiquid committed May 12, 2024
1 parent bad0e80 commit 5bb5ece
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,11 @@ class Player {
if (this.sdk == null) {
return
}
const takeRight = (arr: any[], n = 1): any[] => n === 0 ? [] : arr.slice(-n)
this.queue.add(
...(await this.sdk.recommendations.get({
seed_artists: this.queue.tracks.map(track => track.artists.map(artist => artist.id)).flat(),
seed_tracks: this.queue.tracks.map(track => track.id),
seed_artists: takeRight(this.queue.tracks.map(track => track.artists.map(artist => artist.id)).flat(), 5),
seed_tracks: takeRight(this.queue.tracks.map(track => track.id), 5),
limit: 1
})).tracks
)
Expand Down

0 comments on commit 5bb5ece

Please sign in to comment.