Skip to main content

Hi,

 

I’me developing a custom music service for SONOS in wich custom playlists are provided to be playes (Spotufy alike).
I’ve implemenented the required endpoints and I can see while debugging that the GETLASTUPDATE and GETMETADATA endpoints are called and that the information is show in the APP (Playlists lista, track list by playlist and artist and album info).
The issue is, When I try to reproduce a complete playlist or a track I get a “Unable to add songs to Queue) message and no call is done by the app to the API.
What am I missing here??

 

Bellow you may find some of the endpoints output.

Request:

<getMetadata xmlns="http://www.sonos.com/Services/1.1">
        <id>root</id>
        <index>0</index>
        <count>100</count>
</getMetadata>

Response:

<ns1:getMetadataResponse>
         <ns1:getMetadataResult>
            <ns1:index>0</ns1:index>
            <ns1:count>9</ns1:count>
            <ns1:total>9</ns1:total>
            <ns1:mediaCollection>
               <ns1:id>PLAYLIST:10:2</ns1:id>
               <ns1:itemType>playlist</ns1:itemType>
               <ns1:title>Anos 90</ns1:title>
               <ns1:summary>Relembre os hits que marcaram os anos 90. Da música pop ao grunge, esta playlist conta com as presenças de Alanis Morissette, Oasis, Pearl Jam e The Cranberries</ns1:summary>
               <ns1:canPlay>true</ns1:canPlay>               <ns1:albumArtURI>https://bo.waybox.pt/wbdata/images/playlists/default.jpg</ns1:albumArtURI>
            </ns1:mediaCollection>            
         </ns1:getMetadataResult>
</ns1:getMetadataResponse>

 

Request:

<getMetadata xmlns="http://www.sonos.com/Services/1.1">
        <id>PLAYLIST:10:2</id>
        <index>0</index>
        <count>100</count>
    </getMetadata>

Response:

<ns1:getMetadataResponse>
         <ns1:getMetadataResult>
            <ns1:index>0</ns1:index>
            <ns1:count>100</ns1:count>
            <ns1:total>338</ns1:total>
            <ns1:mediaMetadata>
               <ns1:id>track:300</ns1:id>
               <ns1:title>Black Hole Sun</ns1:title>
               <ns1:mimeType>audio/mp3</ns1:mimeType>
               <ns1:itemType>track</ns1:itemType>
               <ns1:trackMetadata>
                  <ns1:albumId>album:1390</ns1:albumId>
                  <ns1:duration>253970</ns1:duration>
                  <ns1:artistId>artist:543</ns1:artistId>
                  <ns1:artist>Soundgarden</ns1:artist>
                  <ns1:album>Superunknown</ns1:album>
                  <ns1:albumArtURI>https://bo.waybox.pt/musiccover.aspx?pk=bb1fcb2a-8f26-4d35-88a6-02b81067aa4d</ns1:albumArtURI>
               </ns1:trackMetadata>
            </ns1:mediaMetadata>
            <ns1:mediaMetadata>
               <ns1:id>track:514</ns1:id>
               <ns1:title>Don't Speak</ns1:title>
               <ns1:mimeType>audio/mp3</ns1:mimeType>
               <ns1:itemType>track</ns1:itemType>
               <ns1:trackMetadata>
                  <ns1:albumId>album:1128</ns1:albumId>
                  <ns1:duration>207196</ns1:duration>
                  <ns1:artistId>artist:467</ns1:artistId>
                  <ns1:artist>No Doubt</ns1:artist>
                  <ns1:album>Tragic Kingdom</ns1:album>
                  <ns1:albumArtURI>https://bo.waybox.pt/musiccover.aspx?pk=1dd8e5fb-0d50-48fa-9db4-052bbb76dc30</ns1:albumArtURI>
               </ns1:trackMetadata>
            </ns1:mediaMetadata>

</ns1:getMetadataResult>
      </ns1:getMetadataResponse>

You don’t seem to be returning canPlay in the mediaMetadata which is likely significant.


Hi,

I’ve already added the missing properties to the reply, but the result is the same.

When I try to play a track, no call is done to the API to get the track media URL and I get the message

“Unable to add songs to Queue”
<ns1:mediaMetadata>
               <ns1:id>track:121208</ns1:id>
               <ns1:title>Fireflies (Acoustic)</ns1:title>
               <ns1:mimeType>audio/mp3</ns1:mimeType>
               <ns1:itemType>track</ns1:itemType>
               <ns1:isFavorite>true</ns1:isFavorite>
               <ns1:trackMetadata>
                  <ns1:album>Waybox - Winter 2021</ns1:album>
                  <ns1:albumArtist>Ron Pope</ns1:albumArtist>
                  <ns1:albumArtistId>artist:94611</ns1:albumArtistId>
                  <ns1:albumArtURI>https://&URL]/musiccover.aspx?pk= GUID]</ns1:albumArtURI>
                  <ns1:albumId>album:319017</ns1:albumId>
                  <ns1:artist>Ron Pope</ns1:artist>
                  <ns1:artistId>artist:94611</ns1:artistId>
                  <ns1:duration>209</ns1:duration>
                  <ns1:genre>default</ns1:genre>
                  <ns1:genreId>genre:1</ns1:genreId>
                  <ns1:rating>1</ns1:rating>
                  <ns1:trackNumber>1</ns1:trackNumber>
                  <ns1:canPlay>true</ns1:canPlay>
                  <ns1:canSkip>true</ns1:canSkip>
               </ns1:trackMetadata>
            </ns1:mediaMetadata>


If you give me access to your service (via PM) then I can try and debug this further, but debugging via XML on a forum not designed for it isn’t ideal.