可能的 Spotify 肖像元数据缓存错误
要复制的代码
In my app I have the following code.var seed = "spotify:artist:3UbyYnvNIT5DFXU4WgiGpP"; sp.core.getMetadata(seed, { onSuccess: function (metadata) { console.log(metadata); }, onFailure: function () {} });
查看行为的步骤
- 如果 Spotify 已打开,请关闭它,然后重新打开它,打开 Spotify 后运行应用程序并查看显示为的控制台,
Object name: "Whitesnake" portrait: "" type: "artist" uri: "spotify:artist:3UbyYnvNIT5DFXU4WgiGpP" __proto__: Object
- 然后单击广播应用程序并创建一个基于 Whitesnake 乐队的电台。
- 重新运行原始应用程序并查看将显示的控制台输出。
Object name: "Whitesnake" portrait: "spotify:image:3c4aa30d845dd456d750cf16bef8e2cadb2af342" type: "artist" uri: "spotify:artist:3UbyYnvNIT5DFXU4WgiGpP" __proto__: Object
- 退出 Spotify 并重新运行原始应用程序并查看将显示的控制台
Object name: "Whitesnake" portrait: "" type: "artist" uri: "spotify:artist:3UbyYnvNIT5DFXU4WgiGpP" __proto__: Object
问题
为什么无线电应用程序能够访问肖像 uri,然后在使用无线电应用程序后可以从我的应用程序访问该 uri?是否需要首先完成某种初始化,或者这是一个错误?
Code to replicate
In my app I have the following code.
var seed = "spotify:artist:3UbyYnvNIT5DFXU4WgiGpP"; sp.core.getMetadata(seed, { onSuccess: function (metadata) { console.log(metadata); }, onFailure: function () {} });
Steps to view the behaviour
- If spotify is already open close it and then reopen it, after opening spotify run the app and view the console Which displays as
Object name: "Whitesnake" portrait: "" type: "artist" uri: "spotify:artist:3UbyYnvNIT5DFXU4WgiGpP" __proto__: Object
- Then click on the radio app and create a station based on the the band Whitesnake.
- Rerun the original app and view the console output which will display.
Object name: "Whitesnake" portrait: "spotify:image:3c4aa30d845dd456d750cf16bef8e2cadb2af342" type: "artist" uri: "spotify:artist:3UbyYnvNIT5DFXU4WgiGpP" __proto__: Object
- Quit spotify and rerun the original application and view the console which will display
Object name: "Whitesnake" portrait: "" type: "artist" uri: "spotify:artist:3UbyYnvNIT5DFXU4WgiGpP" __proto__: Object
Question
Why is the radio app able to access a portrait uri that is then accessible from my app after using the radio app? Is there some sort of initialization, that needs to be done first or is this a bug?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有关艺术家(和专辑等)的某些信息只有在您“浏览”该 URI 后才可用 - 在此之前,Spotify 仅下载有关项目的基本信息以保持性能。
您所看到的是 Radio 正在进行浏览,这会导致 Spotify 客户端填写缺失的信息。
Spotify 即将推出更新,这将改善这种行为。
Some information on an artist (and album, etc) isn't available until you do a "browse" on that URI - until then, Spotify only downloads basic information on an item to keep performance up.
What you're seeing is the Radio doing a browse, which causes the Spotify client to fill in the missing information.
An update to Spotify is coming soon that will improve this behaviour.
如果我理解正确的话,您是否注意到,在从收音机中获得带有纵向 URI 的结果后,您在应用程序中使用它时会填充该对象数据?
另一方面;您应该使用 Artist 类而不是 sp.core。
这应该会为您提供带有纵向 uri 字符串的正确输出。
If I understood you correctly, you've noticed that after you get the result with a portrait URI from the radio, you get that object data populated when using it in your app?
On another note; you should be using the Artist class instead of sp.core.
This should give you the correct output with a portrait uri string.
正如 iKendac 提到的,尝试进行“浏览”:
示例如下: https://github.com/ptrwtts/kitchensink
As iKenndac mentioned, try doing a 'browse':
Examples here: https://github.com/ptrwtts/kitchensink