Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Request #2

Open
cvaught opened this issue Aug 7, 2013 · 2 comments
Open

Multiple Request #2

cvaught opened this issue Aug 7, 2013 · 2 comments

Comments

@cvaught
Copy link

cvaught commented Aug 7, 2013

I have a dynamic playlist session where I need to get the next song and get the spotify ID for this song. Right now I do the following:

Playlist playlist = session.next(); //request 1
for (Song song : playlist.getSongs())
{
Track track = song.getTrack("spotify-WW"); //request 2
String spotifyID = track.getForeignID(); // request 3
}

This results in 3 api calls. Is there anyway to get the spotify ID at the same time as getting the next song such that it is only 1 api call? If not, then shouldn't track.getForeignID() NOT result in a third request since the foreign id is included in the raw json response?

@nahojkap
Copy link

Having the same issue - you can get EchoNest to return the foreign ids in the 1st request by adding this to the create parameters:

p.add("bucket","id:spotify-WW");
p.add("bucket","tracks");

However, the returned data is not parsed correctly just now from the looks of it - still looking at what the exact issue is

@nahojkap
Copy link

Seems the getTrackNew will not make the request unessarily (if I understand things correctly) - if you also add the buckets above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants