Forums » General Discussion Search

Dynamic playlist next song replaying same song? New Reply

Author Post
Posts: 8
Registered: Jul 01, 2012

I have a dynamic playlist based on similar artists, and it is my understanding, i create the playlist with the parameters,

http://developer.echonest.com/api/v4/playlist/dynamic/create?api_key=(api key)&artist=%@&format=json&type=artist-radio&bucket=id:spotify-WW&bucket=tracks&limit=true this returns the sessionID that i use for future calls. then call http://developer.echonest.com/api/v4/playlist/dynamic/next?api_key=(api key)&format=json&session_id=(sessionID)
to get the next song based on those parameters, but when i call that URL, i get the same song that is currently playing.

Am I correct in understanding the work flow is basically, create the dynamic playlist, I play my song, in this case through spotify, then I call the next dynamic song? Do I need to explicitly mark songs as played on my call to the next dynamic song?

Posts: 926
Registered: Sep 08, 2008

Hi Cawaker -yes, you have the flow right. Create a session and then get songs from the session via the dynamic/next call. You do not need to explicitly mark songs as played. We will assume that any song returned by 'next' was played unless you explicity tell us it wasn't played (via 'feedback skip_song' or 'feedback unplay_song').

Paul

Posts: 8
Registered: Jul 01, 2012

Then how come when i call dynamic/next its just returning the same song?

Posts: 926
Registered: Sep 08, 2008

Cawalker -if you have a led zeppelin playlist you will sometimes get the same song because, of course, for LZ the song remains the same. But other than that, you shouldn't get the same song. Is it possible that your web client is caching responses and is not giving you fresh data for a next call? Depending on your platform, you may have to do some work to make sure that the client libraries don't cache responses. I'd check first to make sure that you are really making multiple dynamic/next calls. If you are and are still getting the same song, then we'll dig in some more.

-- Paul

Posts: 8
Registered: Jul 01, 2012

agh apparently i'm an idiot again, AFNetworking libraries are somehow caching the JSON response, so it just gets the same info. through a web browser, the dynamic/next calls are working, thanks.

Posts: 926
Registered: Sep 08, 2008

Cawaker - great to hear. For many of our calls you can use the jquery-style approach to cache avoidance by appending an '_' parameter and setting the value to a random number. Something like

dynamic/next?api_key=1234&_=random_number

might do the trick

Reply to this Thread

You must log in to post a reply.