在 Spotify 和用户音乐库中搜索特定艺术家或流派
我正在 Spotify 平台上开发第三方应用程序。 其中,用户必须选择他自己的库或必须选择 Spotify 库。 因此,我尝试在用户库和 Spotify 库中搜索特定的艺术家或流派 我有以下代码快照,
var search = new models.Search("akon");
search.localResults = models.LOCALSEARCHRESULTS.APPEND;
search.observe(models.EVENT.CHANGE, function() {
search.artists.forEach(function(artist) {
console.log(artist.name);
});
});
search.appendNext();
但我收到以下错误,
未捕获类型错误:无法读取未定义的属性“APPEND” Uncaught TypeError: Object # has no method 'observe'
是否有功能可以在用户库和 Spotify 库中搜索特定流派和艺术家 或者我必须使用任何第三方库来实现此类功能。 如果是这样,请向我推荐提供此类功能的任何第三方库。 谢谢。
I am developing third party app on spotify platform.
In that, user have to select either his own library or have to choose spotify library.
So, I am trying to search user library and spotify library for particular artist or genre
I am having following code snap,
var search = new models.Search("akon");
search.localResults = models.LOCALSEARCHRESULTS.APPEND;
search.observe(models.EVENT.CHANGE, function() {
search.artists.forEach(function(artist) {
console.log(artist.name);
});
});
search.appendNext();
But I am getting following errors,
Uncaught TypeError: Cannot read property 'APPEND' of undefined
Uncaught TypeError: Object # has no method 'observe'
Is there are functions to search both user library and spotify library for particular genre and artist
or I have to use any third party library for this type of functionality.
If so, then Suggest me about any third party library that provide this type of functionality.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您使用的是最新的预览版(可在此处获取:http:// developer.spotify.com/en/spotify-apps-api/preview/) - 这就是您收到错误的原因。
有关使用搜索的信息,请参阅此处的文档:http:// developer.spotify.com/download/spotify-apps-api/preview/reference/833e3a06d6.html
最后,没有办法“搜索”用户的库,而不是通过循环访问
library.albums
、library.artists
和library.tracks
方法中的项目。再次,请参阅文档。Make sure you're using the latest preview build (available here: http://developer.spotify.com/en/spotify-apps-api/preview/) - that's why you're getting errors.
For using search, see the documentation here: http://developer.spotify.com/download/spotify-apps-api/preview/reference/833e3a06d6.html
Finally, there's no way to "search" the user's library other than by looping through the items in the
library.albums
,library.artists
andlibrary.tracks
methods. Again, see the docs.