Ich versuche, einen SMAPI-Dienst zu implementieren, aber ich stoße auf einige Probleme.Sonos Music API-Implementierung "Musik kann nicht durchsucht werden" Fehler
Ich habe ein “fake” service gebaut, die Antworten hartcodiert für diese Endpunkte gibt:
- getMediaURI
- getLastUpdate
- getMediaMetadata
- getMetadata
- getExtendedMetadata
- GetSessionID
Ich habe die Anweisungen zum Hinzufügen eines benutzerdefinierten Dienstes befolgt, wobei alle Funktionen nicht markiert sind.
Ich sehe meinen neuen Testdienst in meiner Sonos iPhone App, aber wenn ich ihn auswähle, erscheint der Bildschirm "Musik kann nicht durchsucht werden".
Ich bin nicht wirklich sicher, wie man debuggt, was passiert, also fühle mich wie ich in der Dunkelheit stech. Ich möchte keine spekulativen Änderungen vornehmen, die vielleicht nichts mit dem Problem zu tun haben - das scheint ein Rezept für jede Menge verschwendeter Anstrengungen zu sein.
Gibt es eine Möglichkeit, die Fehler der Sonos Controller App (Client) zu sehen? Ich habe die Protokolle http://[device ip]:1400/support/aggregate
ausgecheckt, sehe aber keinen Hinweis auf den Domainnamen meines Dienstes oder sehe etwas, das relevant erscheint.
Ich weiß, dass (zumindest einige) Anfragen meinen Dienst treffen, insbesondere rufen Sie getLastUpdate
und getMetadata
. Hier ist die Ausgabe der Protokolle:
2016-02-23T18:55:24.316373+00:00 app[web.1]: Started POST "/soap/action" for 213.86.218.202 at 2016-02-23 18:55:24 +0000
2016-02-23T18:55:24.316485+00:00 app[web.1]: Started POST "/soap/action" for 213.86.218.202 at 2016-02-23 18:55:24 +0000
2016-02-23T18:55:24.431603+00:00 app[web.1]: Processing by SoapController#get_last_update as HTML
2016-02-23T18:55:24.431611+00:00 app[web.1]: Processing by SoapController#get_last_update as HTML
2016-02-23T18:55:24.438452+00:00 app[web.1]: params.inspect: {}
2016-02-23T18:55:24.438458+00:00 app[web.1]: params.inspect: {}
2016-02-23T18:55:24.447855+00:00 app[web.1]: Rendered vendor/bundle/ruby/2.2.0/gems/wash_out-0.10.0/app/views/wash_out/document/response.builder (7.6ms)
2016-02-23T18:55:24.447907+00:00 app[web.1]: Rendered vendor/bundle/ruby/2.2.0/gems/wash_out-0.10.0/app/views/wash_out/document/response.builder (7.6ms)
2016-02-23T18:55:24.448279+00:00 app[web.1]: Completed 200 OK in 17ms (Views: 9.5ms | ActiveRecord: 0.0ms)
2016-02-23T18:55:24.457801+00:00 app[web.1]: Started POST "/soap/action" for 213.86.218.202 at 2016-02-23 18:55:24 +0000
2016-02-23T18:55:24.448327+00:00 app[web.1]: Completed 200 OK in 17ms (Views: 9.5ms | ActiveRecord: 0.0ms)
2016-02-23T18:55:24.464365+00:00 app[web.1]: Processing by SoapController#get_metadata as HTML
2016-02-23T18:55:24.457861+00:00 app[web.1]: Started POST "/soap/action" for 213.86.218.202 at 2016-02-23 18:55:24 +0000
2016-02-23T18:55:24.464428+00:00 app[web.1]: Processing by SoapController#get_metadata as HTML
2016-02-23T18:55:24.465101+00:00 app[web.1]: params.inspect: {"id"=>"root", "index"=>0, "count"=>100}
2016-02-23T18:55:24.465154+00:00 app[web.1]: params.inspect: {"id"=>"root", "index"=>0, "count"=>100}
2016-02-23T18:55:24.472056+00:00 app[web.1]: Rendered vendor/bundle/ruby/2.2.0/gems/wash_out-0.10.0/app/views/wash_out/document/response.builder (3.4ms)
2016-02-23T18:55:24.472049+00:00 app[web.1]: Rendered vendor/bundle/ruby/2.2.0/gems/wash_out-0.10.0/app/views/wash_out/document/response.builder (3.4ms)
2016-02-23T18:55:24.472248+00:00 app[web.1]: Completed 200 OK in 8ms (Views: 6.9ms | ActiveRecord: 0.0ms)
2016-02-23T18:55:24.472251+00:00 app[web.1]: Completed 200 OK in 8ms (Views: 6.9ms | ActiveRecord: 0.0ms)
Jede mögliche Hilfe würde sehr groß geschätzt werden!
UPDATE Hier ist der Ausgang ist von Anfragen an meinen gefälschten Service mit SoapUI machen:
getLastUpdate
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.sonos.com/Services/1.1"> <soap:Body> <tns:getLastUpdateResponse> <getLastUpdateResult> <catalog>Catalog last updated 2016-02-18 11:52:30</catalog> <favorites>User: Rob last updated favorites 2016-02-18 12:01:00</favorites> <pollInterval>30</pollInterval> </getLastUpdateResult> </tns:getLastUpdateResponse> </soap:Body> </soap:Envelope>
getSessionId
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.sonos.com/Services/1.1"> <soap:Body> <tns:getSessionIdResponse> <getSessionIdResult>user0001</getSessionIdResult> </tns:getSessionIdResponse> </soap:Body> </soap:Envelope>
getMetadata
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.sonos.com/Services/1.1"> <soap:Body> <tns:getMetadataResponse> <getMetadataResult> <index>0</index> <count>2</count> <total>2</total> <mediaMetadata> <id>some_id_1</id> <title>Title 1</title> <mimeType>audio/mp4</mimeType> <itemType>track</itemType> <displayType>List</displayType> <summary>Summary text 1. Summary text 1. Summary text 1.</summary> <trackMetadata> <artistId/> <artist/> <composerId/> <composer/> <albumId/> <album/> <albumArtURI/> <albumArtistId/> <albumArtist/> <genreId/> <genre/> <duration/> <canPlay/> <canSkip/> <canAddToFavorites/> <rating/> <trackNumber/> </trackMetadata> <streamMetadata></streamMetadata> </mediaMetadata> <mediaMetadata> <id>some_id_2</id> <title>Title 2</title> <mimeType>audio/mp4</mimeType> <itemType>track</itemType> <displayType>List</displayType> <summary>Summary text 2. Summary text 2. Summary text 2.</summary> <trackMetadata> <artistId/> <artist/> <composerId/> <composer/> <albumId/> <album/> <albumArtURI/> <albumArtistId/> <albumArtist/> <genreId/> <genre/> <duration/> <canPlay/> <canSkip/> <canAddToFavorites/> <rating/> <trackNumber/> </trackMetadata> <streamMetadata></streamMetadata> </mediaMetadata> </getMetadataResult> </tns:getMetadataResponse> </soap:Body> </soap:Envelope>
getExtendedMetadata
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.sonos.com/Services/1.1"> <soap:Body> <tns:getExtendedMetadataResponse> <getExtendedMetadataResult> <mediaMetadata> <id>some_id_1</id> <title>Title 1</title> <mimeType>audio/mp4</mimeType> <itemType>track</itemType> <displayType>List</displayType> <summary>Summary text 1. Summary text 1. Summary text 1.</summary> <trackMetadata> <artistId/> <artist/> <composerId/> <composer/> <albumId/> <album/> <albumArtURI/> <albumArtistId/> <albumArtist/> <genreId/> <genre/> <duration/> <canPlay/> <canSkip/> <canAddToFavorites/> <rating/> <trackNumber/> </trackMetadata> <streamMetadata></streamMetadata> </mediaMetadata> </getExtendedMetadataResult> </tns:getExtendedMetadataResponse> </soap:Body> </soap:Envelope>
getMediaMetadata
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.sonos.com/Services/1.1"> <soap:Body> <tns:getMediaMetadataResponse> <getMediaMetadataResult> <id/> <title>Fake Track Title</title> <mimeType>audio/mp4</mimeType> <itemType>track</itemType> <displayType/> <summary/> <trackMetadata> <artistId>artist:12345</artistId> <artist>Bach</artist> <composerId/> <composer/> <albumId/> <album/> <albumArtURI>https://sonos.therocketfuel.com/images/istockphoto_1945235_satisfaction.jpg</albumArtURI> <albumArtistId/> <albumArtist/> <genreId/> <genre>Classical</genre> <duration>459</duration> <canPlay>true</canPlay> <canSkip>true</canSkip> <canAddToFavorites>false</canAddToFavorites> <rating/> <trackNumber/> </trackMetadata> <streamMetadata></streamMetadata> </getMediaMetadataResult> </tns:getMediaMetadataResponse> </soap:Body> </soap:Envelope>
getMediaURI
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.sonos.com/Services/1.1"> <soap:Body> <tns:getMediaURIResponse> <getMediaURIResult>https://sonos.therocketfuel.com/audio/960bpm.m4a</getMediaURIResult> </tns:getMediaURIResponse> </soap:Body> </soap:Envelope>