Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/profile/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import (
"context"
"flag"
"fmt"
spotifyauth "github.com/zmb3/spotify/v2/auth"
"log"
"os"

spotifyauth "github.com/zmb3/spotify/v2/auth"

"golang.org/x/oauth2/clientcredentials"

"github.com/zmb3/spotify/v2"
Expand Down Expand Up @@ -39,7 +40,7 @@ func main() {

httpClient := spotifyauth.New().Client(ctx, token)
client := spotify.New(httpClient)
user, err := client.GetUsersPublicProfile(ctx, spotify.ID(*userID))
user, err := client.GetUsersPublicProfile(ctx, *userID)
if err != nil {
fmt.Fprintln(os.Stderr, err.Error())
return
Expand Down
2 changes: 1 addition & 1 deletion playlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ type TrackToRemove struct {

// NewTrackToRemove creates a new TrackToRemove object with the specified
// track ID and playlist locations.
func NewTrackToRemove(trackID string, positions []int) TrackToRemove {
func NewTrackToRemove(trackID ID, positions []int) TrackToRemove {
return TrackToRemove{
URI: fmt.Sprintf("spotify:track:%s", trackID),
Positions: positions,
Expand Down
4 changes: 2 additions & 2 deletions show.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ func (c *Client) GetShow(ctx context.Context, id ID, opts ...RequestOption) (*Fu
// GetShowEpisodes retrieves paginated episode information about a specific show..
// API reference: https://developer.spotify.com/documentation/web-api/reference/#endpoint-get-a-shows-episodes
// Supported options: Market, Limit, Offset
func (c *Client) GetShowEpisodes(ctx context.Context, id string, opts ...RequestOption) (*SimpleEpisodePage, error) {
spotifyURL := c.baseURL + "shows/" + id + "/episodes"
func (c *Client) GetShowEpisodes(ctx context.Context, id ID, opts ...RequestOption) (*SimpleEpisodePage, error) {
spotifyURL := c.baseURL + "shows/" + string(id) + "/episodes"
if params := processOptions(opts...).urlParams.Encode(); params != "" {
spotifyURL += "?" + params
}
Expand Down
2 changes: 1 addition & 1 deletion user.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type PrivateUser struct {

// GetUsersPublicProfile gets public profile information about a
// Spotify User. It does not require authentication.
func (c *Client) GetUsersPublicProfile(ctx context.Context, userID ID) (*User, error) {
func (c *Client) GetUsersPublicProfile(ctx context.Context, userID string) (*User, error) {
spotifyURL := c.baseURL + "users/" + string(userID)

var user User
Expand Down