当我试图从用户播放列表中删除曲目时,控制器使用方法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,即:PLAYLISTS:PLAYLIST: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
显示类型 pmap
<DisplayType id="list">
<DisplayMode>LIST</DisplayMode>
<ItemThumbnails source="albumArtUri"/>
<Lines>
<Line token="title"/>
<Line token="summary"/>
</Lines>
</DisplayType>