diff --git a/examples/profile/profile.go b/examples/profile/profile.go index 17a1768..b3bdec9 100644 --- a/examples/profile/profile.go +++ b/examples/profile/profile.go @@ -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" @@ -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 diff --git a/playlist.go b/playlist.go index ea4be90..cfe0246 100644 --- a/playlist.go +++ b/playlist.go @@ -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, diff --git a/show.go b/show.go index b3a5955..1fffe12 100644 --- a/show.go +++ b/show.go @@ -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 } diff --git a/user.go b/user.go index 76ef603..80e660f 100644 --- a/user.go +++ b/user.go @@ -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