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?
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.