spotify / web-api

This issue tracker is no longer used. Join us in the Spotify for Developers forum for support with the Spotify Web API ➡️ https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer
983 stars 79 forks source link

/me/player/play with specified URIs does not update playlist (on eSDK V.2.46) #615

Open rockfather opened 7 years ago

rockfather commented 7 years ago

Issue found on July 19th 2017.

Endpoint(s):

Steps to reproduce:

  1. Using android client, start playback of tracks on speaker running eSDK V2.46
  2. Call the play endpoint with list of URIs
  3. WEB API responds with 204 code as expected

Expected behavior:

Playlist on client and device update to reflect newly supplied tracks

Actual behavior:

  1. Playlist on client and device do not update
  2. Device fails with ERROR: Metadata error -1400
  3. Any further interaction (from WEB API or android client) problematic (commands ignored or have surprising affects as using playlist which was in use prior to the play being called)

NOTE that this worked as expected on same speaker using same speaker code up until (at least) 8 June 2017

Further Info

Test trace taken from speaker (Linn DS) showing eSDK operation after WEB API request

19/07/17,13:25:34.660,spotify,comms,[PUT https://api.spotify.com/v1/me/player/play] -->> {"uris": ["spotify:track:0h4fRpHrxBeR3XWHmcolaU", "spotify:track:2nWjhmRImt6LScZIPQMBnM", "spotify:track:2nTsKOXIVGDf2iPeVQO2Gm", "spotify:track:5c5a2Ptu8eyIpljhQHjIqk", "spotify:track:28i3xcfokLUIi3KXP7CxBN"]} 19/07/17,13:25:34.759,spotify,comms,[PUT https://api.spotify.com/v1/me/player/play] <<-- (204) 19/07/17,13:25:34.786,Spotify::CallbackDebugMessage aMessage: Got Spirc Type 20 19/07/17,13:25:34.795,Spotify::CallbackDebugMessage aMessage: ESDK: Notifying kSpPlaybackNotifyBecameActive 19/07/17,13:25:34.795,Spotify::CallbackPlaybackNotify aEvent: 9; activeDevice: 0 19/07/17,13:25:34.795,SourceSpotify::NotifyBecameActive iSdkPlayState: 1 19/07/17,13:25:34.795,Spotify::CallbackDebugMessage aMessage: ESDK: Notifying kSpPlaybackNotifyPlay 19/07/17,13:25:34.795,Spotify::CallbackPlaybackNotify aEvent: 0; activeDevice: 1 19/07/17,13:25:34.796,Pipeline state change: buffering 19/07/17,13:25:34.796,SourceSpotify::NotifyPlay iSdkPlayState: 1 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: stop_audio_out reset_decoder 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: stop_audio_out send_end_track 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: ESDK: Notifying kSpPlaybackEventAudioFlush 19/07/17,13:25:34.796,Spotify::CallbackPlaybackNotify aEvent: 12; activeDevice: 1 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: stop_audio_out reset_decoder 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: stop_audio_out send_end_track 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: ESDK: Notifying kS 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: ESDK: Notifying kSpPlaybackEventAudioFlush 19/07/17,13:25:34.796,Spotify::CallbackPlaybackNotify aEvent: 12; activeDevice: 1 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.848,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.848,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.848,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.848,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.901,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.901,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.901,Spotify::CallbackDebugMessage aMessage: ERROR: Metadata error -1400 19/07/17,13:25:34.901,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.901,Spotify::CallbackDebugMessage aMessage: Error retrieving metadata; permanent failure. (-1400) 19/07/17,13:25:34.901,Spotify::CallbackDebugMessage aMessage: WARNING: Continuing with stale metadata.,, 19/07/17,13:25:34.901,Spotify::CallbackDebugMessage aMessage: TL got last_abs_index 0

Possibly duplicate of #602 #598

rockfather commented 7 years ago

NOTE that calling the endpoint with a context such as a playlist or album works as expected

EnyxRB commented 7 years ago

@rockfather Could you leave an example of how using a context_uri works in that case? As I can't seem to get it working when sending the json data.

rockfather commented 7 years ago

The following works for me using a playlist context

PUT https://api.spotify.com/v1/me/player/play -->> {"context_uri":"spotify:user:spotifyhwp:playlist:5XpO873pTWez7aV6RuOsW1","offset":{"position":0}},

giving a 204 response (as expected)

EnyxRB commented 7 years ago

I'm doing it in the json format, I was wondering how would I need to arrange it in this format? As using the same context and offset still just play the current song and don't change it.

request({
        method: 'PUT',
    uri: 'https://api.spotify.com/v1/me/player/play',
    headers:{
        Authorization: 'Bearer ' + access_token
    },
    data:{
        "context_uri": "spotify:user:spotifyhwp:playlist:5XpO873pTWez7aV6RuOsW1",
        "offset": {
            "position": 0
        }
    }
}, function (error, response, body) {   
    console.log(response);                      
});

Sorry to be so specific, I've been trying to figure out why my json doesn't send the context_uri properly for a month now. Should data be called something else for spotify to receive the context uri?

rockfather commented 7 years ago

If you are getting a 204 response, then the syntax and format of the request is correct. The symptoms you describe (play existing song) are the same as I was observing when using this command with list of URIs rather than context. Suspect this is the same (or closely related bug) to this ticket that you are seeing