gpt4 book ai didi

soap - 从播放列表中删除轨道调用 deleteContainer 而不是 removeFromContainer

转载 作者:行者123 更新时间:2023-12-01 06:18:37 25 4
gpt4 key购买 nike

当我尝试从用户播放列表中删除轨道时, Controller 使用方法 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 &amp; Friends</ns1:summary>
<ns1:mimeType>audio/mp3</ns1:mimeType>
<ns1:trackMetadata>
<ns1:artist>Phil Lesh &amp; 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>

最佳答案

播放列表编辑的设计方式, Controller 希望各个播放列表容器的 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 为“收藏夹”,子容器也将继承收藏夹行为,您仍然可以在调用 getLastUpdate 时刷新各个播放列表的内容。您还可以在 mediaCollection 中包含 containsFavorite 节点,并将各个播放列表的值设置为 true(请参阅此处有关 containsFavorite 的文档:http://musicpartners.sonos.com/node/83)。

我们将在内部调查当“播放列表”以外的项目类型用于单个播放列表容器时的行为。如果您有任何其他问题,请告诉我们。

关于soap - 从播放列表中删除轨道调用 deleteContainer 而不是 removeFromContainer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37511700/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com