在 Spotify 和用户音乐库中搜索特定艺术家或流派

发布于 2025-01-04 00:13:17 字数 659 浏览 2 评论 0原文

我正在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别忘他 2025-01-11 00:13:17

确保您使用的是最新的预览版(可在此处获取:http:// developer.spotify.com/en/spotify-apps-api/preview/) - 这就是您收到错误的原因。

有关使用搜索的信息,请参阅此处的文档:http:// developer.spotify.com/download/spotify-apps-api/preview/reference/833e3a06d6.html

最后,没有办法“搜索”用户的库,而不是通过循环访问 library.albumslibrary.artistslibrary.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 and library.tracks methods. Again, see the docs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文