Skip to content

Commit

Permalink
Use auth client when searching
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiofalci committed May 31, 2017
1 parent be1167f commit c79fbb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spotify/spotify_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ func (spotify *Spotify) search(query string) {

playlist := sconsify.InitSearchPlaylist(name, name, func(playlist *sconsify.Playlist) {
options := createWebSpotifyOptions(50, playlist.Tracks())
// TODO use spotify.client while still token valid, then switch to Default one
if searchResult, err := webspotify.DefaultClient.SearchOpt(query, webspotify.SearchTypeTrack, options); err == nil {
// search is an auth endpoint now, when the token expires, it won't work
if searchResult, err := spotify.client.SearchOpt(query, webspotify.SearchTypeTrack, options); err == nil {
numberOfTracks := len(searchResult.Tracks.Tracks)
infrastructure.Debugf("Search '%v' returned %v track(s)", query, numberOfTracks)
for _, track := range searchResult.Tracks.Tracks {
Expand Down

0 comments on commit c79fbb9

Please sign in to comment.