gameover
gameover

Reputation: 45

Adding an entire album as an individual playlist (subscribe to album as playlist)

My app displays a list of albums and I would like the user to be able to click and "add album as playlist" so it shows up in the left-hand panel under playlists and stays there even when Spotify is restarted.

I have tried doing this by creating a playlist with "new models.Playlist();" and adding all tracks from the album into that playlist. This works fine (all tracks that I have added to the playlist appear in the console as does the name), but when I try to add to the left panel using playlist.subscribed=true, it does not work as the URI generated is not a valid playlislt URI, and instead looks something like this (appears to be a temporary playlist): spotify:internal:temp_playlist:spotify:app:xxxxx@1001094095006

How can I add an entire album, let the user subscribe as playlist and then ensure it doesn't disappear once Spotify is closed?

The album URI isn't accepted either and I can't find any way to do this in the resources.

Upvotes: 0

Views: 201

Answers (1)

iKenndac
iKenndac

Reputation: 18776

Make sure you give the playlist a name when making it, like this:

new models.Playlist("My Awesome Playlist");

This behaviour is documented here.

Upvotes: 1

Related Questions