概括
itemType=other如果某个项目还具有自定义浏览图标,Sonos 自检套件似乎会错误地失败。
我认为项目类型other应包含在此列表中utility.py:
17 BROWSEABLE_CONTAINER_TYPES = ('artist', 'album', 'genre', 'playlist', 'favorites', 'albumList', 'trackList', 'artistTrackList', 'container', 'favorite', 'collection', 'program', 'show')
细节
运行 sonos 自检套件时,我收到以下错误作为输出的一部分:
...
INFO Start Test Case: 844 Albumart test_custom_browse_icon_configuration
STOP Discovered custom browse icon URI should be something other than None. (is None)
STOP 844 Albumart test_custom_browse_icon_configuration
...
通过调试albumart.py(test_custom_browse_icon_configuration方法),我将问题追溯到该get_sample_custom_browse_icon_url方法的以下摘录:
# TODO: Need to drill down one level deeper if the target image url cannot be found on the root level containers
for mediaColl in response.Items:
if mediaColl.itemType in container_types:
if substitution_str in mediaColl.albumArtURI:
return mediaColl.albumArtURI
elif hasattr(mediaColl.albumArtURI,'value') and substitution_str in mediaColl.albumArtURI.value:
return mediaColl.albumArtURI.value
此代码应该找到带有自定义专辑封面的容器。然而,事实证明这container_types是由前面的一行定义的:
container_types = [t for t in Validation.BROWSEABLE_CONTAINER_TYPES if t.lower() != 'album']
并Validation.BROWSEABLE_CONTAINER_TYPES定义utility.py如下:
# sonos-selftest/smapi/content_workflow/utility.py
15 class Validation(WorkflowTestFixture, SMAPIClient, SMAPIService):
16
17 BROWSEABLE_CONTAINER_TYPES = ('artist', 'album', 'genre', 'playlist', 'favorites', 'albumList', 'trackList', 'artistTrackList', 'container', 'favorite', 'collection', 'program', 'show')
请注意,'other'此列表中缺少该类型!我很确定它应该包含在列表中,browse.py提到它:
234 **Reference:** BROWSEABLE_CONTAINER_TYPES = 'artist', 'album', 'genre', 'playlist', 'favorites', 'albumList', 'trackList', 'artistTrackList', 'container', 'favorite', 'collection', 'other', ' program'
解决方法
itemType=other我可以通过更改为itemType=container(几乎等效)来解决这个问题。
但是,如果这在 Sonos 自测套件的未来版本中得到修复,那就太好了。