0

I've been developing a music Service for Sonos and have everything up and running. The problem I have is Sonos only requests 99 items through it's getMetadata call, some of my libraries have 300+ tracks in, so I'd ideally like to list them all out.

I can't find anything in the Sonos api documentation about how to list 100 or more items but I'm assuming it is possible because their reference page for getScrollIndices (http://musicpartners.sonos.com/node/103) alludes to a library much larger than 100 tracks.

4

1 回答 1

1

您可以通过在presentationmap.xml 文件中将值设置为更适合您的服务getMetadata的值来设置调用中请求的默认项目数。BrowseOptions.PageSize

例如:

<?xml version="1.0" encoding="utf-8" ?>
<Presentation>
   <!-- I chose 400 based on your 300+ value in the question. -->
   <BrowseOptions PageSize="400" />
</Presentation>

您可以在下面的链接中找到文档。向下滚动到“浏览选项”:

http://musicpartners.sonos.com/node/222

您可以在此处找到有关如何配置 Sonos 以在本地测试期间读取您的演示地图的文档:

http://musicpartners.sonos.com/node/134

本质上,您需要将 XML 文件托管在服务器上(通常与托管 Sonos API 代码的服务器相同),并以直接指向presentationmap.xml 文件的customSD 形式配置URL。

注意:Sonos 缓存 XML 文件以提高性能。更改文件时,您必须增加 customSD 表单中的版本,以便 Sonos 控制器强制重新加载。这在此处文档的“版本”条目中进行了解释:

http://musicpartners.sonos.com/node/134

于 2017-02-23T06:23:28.500 回答