Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help with functions
13-05-2013, 08:28 AM (This post was last modified: 13-05-2013 09:01 AM by andreww.)
Post: #2
RE: help with functions
First of all, you can get a PlaylistContainer by calling Playlistcontainer() on your SpotifySession object. It might not be loaded yet, so use IsLoaded() to check. If you need to wait for the PlaylistContainer to load, you can use AddCallbacks to register callbacks. Once it's loaded, you can use the methods NumPlaylists, Playlist, PlaylistType, PlaylistFolderName and PlaylistFolderId to inspect the playlists. Note that Spotify uses a slightly odd mechanism to tell you about playlist folders. If you have this structure:

Code:
Container
+--Playlist A
+--Playlist B
+--Folder X
|  +--Playlist C
|  \--Playlist D
+--Playlist E
\--Folder Y
   \--Playlist F

Spotify will represent this as 10 'playlists':
Code:
0. Playlist A
1. Playlist B
2. Start of folder X
3. Playlist C
4. Playlist D
5. End of folder X
6. Playlist E
7. Start of folder Y
8. Playlist F
9. End of folder Y

The PlaylistType is used to distinguish actual playlists from markers indicating the start and end of folders.

Creating a playlist in a PlaylistContainer is done with AddNewPlaylist(). That will return you a playlist to which you can add and remove tracks.
Visit this user's website Find all posts by this user


Messages In This Thread
help with functions - mfacer - 11-05-2013, 09:27 AM
RE: help with functions - andreww - 13-05-2013 08:28 AM

Forum Jump: