Implement TopTracksView

This commit is contained in:
aditya-K2
2023-04-14 01:05:31 +05:30
parent b99f9180a7
commit 1a4c61ea5d
4 changed files with 97 additions and 9 deletions

View File

@@ -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
}