【发布时间】:2020-09-04 15:10:28
【问题描述】:
我已尽一切努力改变这一点...不知道出了什么问题,无论如何它仍然只是将 20 位艺术家拉回来。
const sp = await this.getValidSPObj();
const { id: userId } = await sp.getMe();
const { items: topArtists } = await sp.getMyTopArtists(userId, {limit: 10, offset: 20});
this.props.setData("TopArtists", topArtists);
API 说明...
/**
* Get the current user’s top artists based on calculated affinity.
* See [Get a User’s Top Artists](https://developer.spotify.com/web-api/get-users-top-artists-and-tracks/) on
* the Spotify Developer site for more information about the endpoint.
*
* @param {Object} options A JSON object with options that can be passed
* @param {function(Object,Object)} callback An optional callback that receives 2 parameters. The first
* one is the error object (null if no error), and the second is the value if the request succeeded.
* @return {Object} Null if a callback is provided, a `Promise` object otherwise
*/
getMyTopArtists(
options?: Object,
callback?: ResultsCallback<SpotifyApi.UsersTopArtistsResponse>
): Promise<SpotifyApi.UsersTopArtistsResponse>;
【问题讨论】:
标签: reactjs api native spotify