Skip to content

client.Search for SearchTypeShow returns zero values #257

@Santiago-Balcero

Description

@Santiago-Balcero

Hi!

Currently working in a project with this Spotify client. When using client.Search for SearchTypeShow it always returns zero values of type SimpleShowPage.

I create client in this way:

ctx := context.Background()
	authConfig := &clientcredentials.Config{
		ClientID:     SpotifyId,
		ClientSecret: SpotifySecret,
		TokenURL:     spotifyauth.TokenURL,
	}

	accessToken, err := authConfig.Token(ctx)
	if err != nil {
		log.Fatal("Error creating spotify client: ", err)
	}
	httpClient := spotifyauth.New().Client(ctx, accessToken)
	Spotify = *spotify.New(httpClient)

This is the line I use to call the search method, being podcastName a string:

result, err := client.Search(ctx, podcastName, spotify.SearchTypeShow)
if err != nil {
	return "", fmt.Errorf("error searching podcast: %v", err)
}

log.Println(result.Shows)

And this is what I get as result.Shows no matter which podcastName value I use:

2024/03/28 20:54:39 &{{https://api.spotify.com/v1/search?query=cosas+de+profes&type=show&offset=0&limit=20 20 0 399 https://api.spotify.com/v1/search?query=cosas+de+profes&type=show&offset=20&limit=20 } [{{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}} {{[] []  false map[]   [] <nil> []     } {{ 0 0 0  } []}}]}

I am using the exact same way to search for SearchTypeArtist, which works perfectly.

Any help or comments would be helpful. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions