mirror of
https://github.com/aditya-K2/gspt.git
synced 2026-01-08 21:37:58 -05:00
Implement TopTracksView
This commit is contained in:
10
spt/get.go
10
spt/get.go
@@ -217,3 +217,13 @@ func RecentlyPlayed() ([]spotify.RecentlyPlayedItem, error) {
|
||||
func GetPlayerState() (*spotify.PlayerState, error) {
|
||||
return Client.PlayerState(ctx())
|
||||
}
|
||||
|
||||
func GetTopTracks() ([]spotify.FullTrack, error) {
|
||||
c, err := Client.CurrentUsersTopTracks(ctx(), spotify.Limit(10))
|
||||
return c.Tracks, err
|
||||
}
|
||||
|
||||
func GetTopArtists() ([]spotify.FullArtist, error) {
|
||||
c, err := Client.CurrentUsersTopArtists(ctx(), spotify.Limit(10))
|
||||
return c.Artists, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user