0

From the header documentation of SPPlaylist for it's image property:

Returns the custom image for the playlist, or nil if the playlist hasn't loaded yet or it doesn't have a custom image

I have an array of loaded SPPlaylists however the image property on each object is always nil, even though I can see the 4-up image on those same playlists via the Spotify client.

Is there an easy way to obtain that 4-up cover image using CocoaLibSpotify? Or do I have to load all track and album metadata and pull back relevant SPImages individually?

followben
  • 9,067
  • 4
  • 40
  • 42

1 Answers1

2

The image of a playlist is for when branded playlists have custom images. This is fairly rare, though.

The reason the grid isn't generated for you is because it's generated locally rather than server-side, so it'd mean loading multiple album's worth of images every time a playlist is loaded, which isn't that memory efficient.

However, there's an open-source Spotify client called Viva built on CocoaLibSpotify (disclosure: written by me) that generates these images. Have a look at the VivaImageExtensions class extension for a reference implementation.

It's worth nothing that the reference implementation there requires that the tracks you pass have had their album cover arts loaded first.

iKenndac
  • 18,730
  • 3
  • 35
  • 51
  • Cheers Daniel, suspected as much. I'd missed those image extensions in Viva; very handy. Our UI calls for a list of a user's playlists with mosaic images displayed alongside. Means loading (and waiting for) all track and album metadata for all playlists in the user's container. Will do it all async of course, but would be nice to have it on SPPlaylist as part of Spotify's API :) – followben Jan 23 '13 at 01:13
  • What I meant was: be nice to have it on SPPlaylist but generated server-side as part of Spotify's API... – followben Jan 23 '13 at 02:28