当我尝试从用户播放列表中删除曲目时,控制器使用方法 deleteContainer 发送SOAP请求,即:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<credentials xmlns="http://www.sonos.com/Services/1.1">
<sessionId>574ae2c7e83b03.16748534_6f1bc18ac2878c101d2f28a0a4cdf2a8</sessionId>
<deviceId>B8-E9-37-EF-29-1E:8</deviceId>
<deviceProvider>Sonos</deviceProvider>
</credentials>
</s:Header>
<s:Body>
<deleteContainer xmlns="http://www.sonos.com/Services/1.1">
<id>TRACK:272228:13306</id>
</deleteContainer>
</s:Body>
</s:Envelope>
但我可以看到有一个方法removeFromContainer,我认为这个方法应该用于从播放列表中删除曲目。
我在Android APP和MacOS Sonos App中遇到此问题。我正在删除曲目,而不是播放列表。删除播放列表时,它会使用相同的方法 deleteContainer ,但使用正确的ID,即:播放列表:播放列表:23952
我错了吗?在哪种情况下会使用方法 removeFromContainer ?
请求
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<credentials xmlns="http://www.sonos.com/Services/1.1">
<sessionId>574dd9f69e8ad1.86333620_6f1bc18ac2878c101d2f28a0a4cdf2a8</sessionId>
<deviceId>B8-E9-37-EF-29-1E:8</deviceId>
<deviceProvider>Sonos</deviceProvider>
</credentials>
</s:Header>
<s:Body>
<getMetadata xmlns="http://www.sonos.com/Services/1.1">
<id>playlists</id>
<index>0</index>
<count>100</count>
</getMetadata>
</s:Body>
</s:Envelope>
响应
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://www.sonos.com/Services/1.1">
<SOAP-ENV:Body>
<ns1:getMetadataResponse>
<ns1:getMetadataResult>
<ns1:index>0</ns1:index>
<ns1:count>2</ns1:count>
<ns1:total>2</ns1:total>
<ns1:mediaCollection readOnly="false" userContent="true" renameable="true">
<ns1:id>PLAYLISTS:PLAYLIST:23952</ns1:id>
<ns1:itemType>favorite</ns1:itemType>
<ns1:displayType>list</ns1:displayType>
<ns1:title>Another playlist</ns1:title>
<ns1:summary>39 songs 18486</ns1:summary>
<ns1:canPlay>true</ns1:canPlay>
<ns1:canEnumerate>true</ns1:canEnumerate>
</ns1:mediaCollection>
<ns1:mediaCollection readOnly="false" userContent="true" renameable="true">
<ns1:id>PLAYLISTS:PLAYLIST:28331</ns1:id>
<ns1:itemType>favorite</ns1:itemType>
<ns1:displayType>list</ns1:displayType>
<ns1:title>Some playlist</ns1:title>
<ns1:summary>21 songs 10454</ns1:summary>
<ns1:canPlay>true</ns1:canPlay>
<ns1:canEnumerate>true</ns1:canEnumerate>
</ns1:mediaCollection>
</ns1:getMetadataResult>
</ns1:getMetadataResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
请求
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<credentials xmlns="http://www.sonos.com/Services/1.1">
<sessionId>574dd9f69e8ad1.86333620_6f1bc18ac2878c101d2f28a0a4cdf2a8</sessionId>
<deviceId>B8-E9-37-EF-29-1E:8</deviceId>
<deviceProvider>Sonos</deviceProvider>
</credentials>
</s:Header>
<s:Body>
<getMetadata xmlns="http://www.sonos.com/Services/1.1">
<id>PLAYLISTS:PLAYLIST:28331</id>
<index>0</index>
<count>100</count>
</getMetadata>
</s:Body>
</s:Envelope>
响应
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://www.sonos.com/Services/1.1">
<SOAP-ENV:Body>
<ns1:getMetadataResponse>
<ns1:getMetadataResult>
<ns1:index>0</ns1:index>
<ns1:count>21</ns1:count>
<ns1:total>21</ns1:total>
<ns1:mediaMetadata>
<ns1:id>TRACK:273257:14098</ns1:id>
<ns1:itemType>track</ns1:itemType>
<ns1:displayType></ns1:displayType>
<ns1:title>Dark Star</ns1:title>
<ns1:summary>Phil Lesh & Friends</ns1:summary>
<ns1:mimeType>audio/mp3</ns1:mimeType>
<ns1:trackMetadata>
<ns1:artist>Phil Lesh & Friends</ns1:artist>
<ns1:duration>1030</ns1:duration>
<ns1:rating>0</ns1:rating>
<ns1:albumArtURI>http://www.livedownloads.com/images/shows/phil160318_02.jpg</ns1:albumArtURI>
<ns1:canPlay>true</ns1:canPlay>
<ns1:canSkip>true</ns1:canSkip>
</ns1:trackMetadata>
</ns1:mediaMetadata>
[other items]
</ns1:getMetadataResult>
</ns1:getMetadataResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
请求
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<credentials xmlns="http://www.sonos.com/Services/1.1">
<sessionId>574dd9f69e8ad1.86333620_6f1bc18ac2878c101d2f28a0a4cdf2a8</sessionId>
<deviceId>B8-E9-37-EF-29-1E:8</deviceId>
<deviceProvider>Sonos</deviceProvider>
</credentials>
</s:Header>
<s:Body>
<deleteContainer xmlns="http://www.sonos.com/Services/1.1">
<id>TRACK:263512:12867</id>
</deleteContainer>
</s:Body>
</s:Envelope>
从MacOS Sonos应用关于对话框:
Version: 6.2.2
Build: 31927221
Sonos ID: 115034936
Sonos设备信息:
PLAY:1: Living Room
Serial Number: B8-E9-37-EF-29-1E:8
Version: 6.2 (build 31926010)
Hardware Version: 1.8.3.7-1
IP Address: 192.168.0.108
WM: 1
OTP:
来自Android Sonos应用
Sonos ID: 115034936
Version: 6.2.2 (build 31927151)
http://192.168.0.108:1400/status/VERSION
contents of /VERSION
31.9-26010
<DisplayType id="list">
<DisplayMode>LIST</DisplayMode>
<ItemThumbnails source="albumArtUri"/>
<Lines>
<Line token="title"/>
<Line token="summary"/>
</Lines>
</DisplayType>
答案 0 :(得分:3)
设计播放列表编辑的方式,控制器期望各个播放列表容器具有itemType“播放列表”。修复上述行为的方法是将每个播放列表容器设置为itemType“播放列表”。
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://www.sonos.com/Services/1.1">
<SOAP-ENV:Body>
<ns1:getMetadataResponse>
<ns1:getMetadataResult>
<ns1:index>0</ns1:index>
<ns1:count>2</ns1:count>
<ns1:total>2</ns1:total>
<ns1:mediaCollection readOnly="false" userContent="true" renameable="true">
<ns1:id>PLAYLISTS:PLAYLIST:23952</ns1:id>
<ns1:itemType>playlist</ns1:itemType>
<ns1:displayType>list</ns1:displayType>
<ns1:title>Another playlist</ns1:title>
<ns1:summary>39 songs 18486</ns1:summary>
<ns1:canPlay>true</ns1:canPlay>
<ns1:canEnumerate>true</ns1:canEnumerate>
</ns1:mediaCollection>
<ns1:mediaCollection readOnly="false" userContent="true" renameable="true">
<ns1:id>PLAYLISTS:PLAYLIST:28331</ns1:id>
<ns1:itemType>playlist</ns1:itemType>
<ns1:displayType>list</ns1:displayType>
<ns1:title>Some playlist</ns1:title>
<ns1:summary>21 songs 10454</ns1:summary>
<ns1:canPlay>true</ns1:canPlay>
<ns1:canEnumerate>true</ns1:canEnumerate>
</ns1:mediaCollection>
</ns1:getMetadataResult>
</ns1:getMetadataResponse>
</SOAP-ENV:Body>
由于父容器的itemType为“favorites”,子项还将继承收藏夹行为,您仍然可以在getLastUpdate调用时刷新各个播放列表的内容。您还可以在mediaCollection中包含containsFavorite节点,并将各个播放列表的值设置为true(请参阅containsFavorite:http://musicpartners.sonos.com/node/83中的文档。)
我们将在内部调查当“播放列表”以外的itemType用于各个播放列表容器时的行为。如果您有任何其他问题,请告诉我们。