SMAPI getExtendedMetadata 调用两次,getMediaURI 从未调用,播放无法工作

问题描述 投票:0回答:1

使用

soap
包在 Node 中创建 SMAPI 的过程中。到目前为止,我已经
getMetadata
可以工作了,可以深入研究专辑和子专辑。

我的问题是,当我单击曲目时,它会显示为正在播放,但从未播放,并且我的 API

getMediaURI
从未被调用。然而所谓的是
getExtendedMetadata
,两次。

这是我的实施与 Sonos 之间的集成示例:

<!-- Server received -->

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns="http://www.sonos.com/Services/1.1">
    <soap:Header>
        <credentials xmlns="http://www.sonos.com/Services/1.1">
            <deviceProvider>Sonos</deviceProvider>
        </credentials>
        <ns:context>
            <contentFiltering>
                <explicit>false</explicit>
            </contentFiltering>
            <ns:timeZone>+02:00</ns:timeZone>
        </ns:context>
    </soap:Header>
    <soap:Body>
        <ns:getMetadata xmlns="http://www.sonos.com/Services/1.1">
            <id>root</id>
            <index>0</index>
            <count>100</count>
        </ns:getMetadata>
    </soap:Body>
</soap:Envelope>

<!-- Server responded -->

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:tns="http://www.sonos.com/Services/1.1">
    <soap:Body>
        <getMetadataResponse xmlns="http://www.sonos.com/Services/1.1">
            <index>0</index>
            <count>100</count>
            <total>2</total>
            <getMetadataResult>
                <mediaCollection>
                    <id>wheel:soundwheel</id>
                    <itemType>container</itemType>
                    <displayType>genreMood</displayType>
                    <title>SoundWheel</title>
                    <summary>SoundWheel summary</summary>
                    <canPlay>false</canPlay>
                    <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                </mediaCollection>
                <mediaCollection>
                    <id>wheel:kidswheel</id>
                    <itemType>container</itemType>
                    <displayType>genreMood</displayType>
                    <title>SoundWheel Kids</title>
                    <summary>SoundWheel Kids summary</summary>
                    <canPlay>false</canPlay>
                    <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                </mediaCollection>
                <mediaCollection>
                    <id>wheel:workwheel</id>
                    <itemType>container</itemType>
                    <displayType>genreMood</displayType>
                    <title>SoundWheel Work</title>
                    <summary>SoundWheel Work summary</summary>
                    <canPlay>false</canPlay>
                    <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                </mediaCollection>
                <mediaCollection>
                    <id>wheel:youngwheel</id>
                    <itemType>container</itemType>
                    <displayType>genreMood</displayType>
                    <title>SoundWheel Young</title>
                    <summary>SoundWheel Young summary</summary>
                    <canPlay>false</canPlay>
                    <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                </mediaCollection>
            </getMetadataResult>
        </getMetadataResponse>
    </soap:Body>
</soap:Envelope>

<!-- Server received -->

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns="http://www.sonos.com/Services/1.1">
    <soap:Header>
        <credentials xmlns="http://www.sonos.com/Services/1.1">
            <deviceProvider>Sonos</deviceProvider>
        </credentials>
        <ns:context>
            <contentFiltering>
                <explicit>false</explicit>
            </contentFiltering>
            <ns:timeZone>+02:00</ns:timeZone>
        </ns:context>
    </soap:Header>
    <soap:Body>
        <ns:getMetadata xmlns="http://www.sonos.com/Services/1.1">
            <id>wheel:soundwheel</id>
            <index>0</index>
            <count>100</count>
        </ns:getMetadata>
    </soap:Body>
</soap:Envelope>

<!-- Server responded -->

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:tns="http://www.sonos.com/Services/1.1">
    <soap:Body>
        <getMetadataResponse xmlns="http://www.sonos.com/Services/1.1">
            <index>0</index>
            <count>9</count>
            <total>9</total>
            <getMetadataResult>
                <mediaCollection>
                    <id>theme:2b1bbc7b-288f-4a9d-8d5c-357631daaf11</id>
                    <itemType>container</itemType>
                    <displayType>genreMood</displayType>
                    <title>Receive</title>
                    <summary>Receive in good faith. You are supported and held.</summary>
                    <canPlay>false</canPlay>
                    <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                </mediaCollection>
                <mediaCollection>
                    <id>theme:173b2bcf-080f-4820-9402-44e3e71631fc</id>
                    <itemType>container</itemType>
                    <displayType>genreMood</displayType>
                    <title>Ground</title>
                    <summary>Peace and grounding. Out of your mind and into your body.</summary>
                    <canPlay>false</canPlay>
                    <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                </mediaCollection>
                <mediaCollection>
                    <id>theme:f84b0106-d24b-44ea-a261-278d4be692ca</id>
                    <itemType>container</itemType>
                    <displayType>genreMood</displayType>
                    <title>Charge</title>
                    <summary>New energy into all of your cells and time to recharge your batteries.</summary>
                    <canPlay>false</canPlay>
                    <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                </mediaCollection>
                <mediaCollection>
                    <id>theme:c15ac5b5-0fe4-43c4-b7de-0e1ed5d82ef7</id>
                    <itemType>container</itemType>
                    <displayType>genreMood</displayType>
                    <title>Reconnect</title>
                    <summary>You&apos;re connected to it all through the connection to yourself. </summary>
                    <canPlay>false</canPlay>
                    <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                </mediaCollection>
                <mediaCollection>
                    <id>theme:a8928b47-7fdb-4c80-8b1e-8af9863bd524</id>
                    <itemType>container</itemType>
                    <displayType>genreMood</displayType>
                    <title>Move</title>
                    <summary>Mental flexibility. Get over, under, through and onwards. </summary>
                    <canPlay>false</canPlay>
                    <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                </mediaCollection>
                <mediaCollection>
                    <id>theme:9f02082e-a732-4b9d-94ec-c4a7f2ab2807</id>
                    <itemType>container</itemType>
                    <displayType>genreMood</displayType>
                    <title>Release</title>
                    <summary>Let go of the excess baggage. </summary>
                    <canPlay>false</canPlay>
                    <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                </mediaCollection>
                <mediaCollection>
                    <id>theme:55b043a3-4449-4fa9-8c8b-f2fb5f6c7aef</id>
                    <itemType>container</itemType>
                    <displayType>genreMood</displayType>
                    <title>Create</title>
                    <summary>Manifest your dreams from a point of bliss.</summary>
                    <canPlay>false</canPlay>
                    <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                </mediaCollection>
                <mediaCollection>
                    <id>theme:31a62c8f-2030-457f-bae5-0a6603a178aa</id>
                    <itemType>container</itemType>
                    <displayType>genreMood</displayType>
                    <title>Rest</title>
                    <summary>Take a break and let it all stop for a moment.</summary>
                    <canPlay>false</canPlay>
                    <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                </mediaCollection>
                <mediaCollection>
                    <id>theme:ad52708a-a943-461b-a6ac-25feb80a8f6d</id>
                    <itemType>container</itemType>
                    <displayType>genreMood</displayType>
                    <title>Rise</title>
                    <summary>Face the depths within you. Ascend to new heights.</summary>
                    <canPlay>false</canPlay>
                    <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                </mediaCollection>
            </getMetadataResult>
        </getMetadataResponse>
    </soap:Body>
</soap:Envelope>

<!-- Server received -->

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns="http://www.sonos.com/Services/1.1">
    <soap:Header>
        <credentials xmlns="http://www.sonos.com/Services/1.1">
            <deviceProvider>Sonos</deviceProvider>
        </credentials>
        <ns:context>
            <contentFiltering>
                <explicit>false</explicit>
            </contentFiltering>
            <ns:timeZone>+02:00</ns:timeZone>
        </ns:context>
    </soap:Header>
    <soap:Body>
        <ns:getExtendedMetadata xmlns="http://www.sonos.com/Services/1.1">
            <id>wheel:soundwheel</id>
        </ns:getExtendedMetadata>
    </soap:Body>
</soap:Envelope>

<!-- Server responded -->

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:tns="http://www.sonos.com/Services/1.1">
    <soap:Body>
        <getExtendedMetadataResponse xmlns="http://www.sonos.com/Services/1.1">
            <getExtendedMetadataResult>
                <mediaCollection>
                    <id>wheel:soundwheel</id>
                    <itemType>album</itemType>
                    <title>SoundWheel</title>
                    <artist>SoundWheel</artist>
                    <artistId>soundwheel</artistId>
                    <canScroll>false</canScroll>
                    <canPlay>true</canPlay>
                    <canEnumerate>true</canEnumerate>
                    <canAddToFavorites>true</canAddToFavorites>
                    <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                </mediaCollection>
            </getExtendedMetadataResult>
        </getExtendedMetadataResponse>
    </soap:Body>
</soap:Envelope>

<!-- Server received -->

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns="http://www.sonos.com/Services/1.1">
    <soap:Header>
        <credentials xmlns="http://www.sonos.com/Services/1.1">
            <deviceProvider>Sonos</deviceProvider>
        </credentials>
        <ns:context>
            <contentFiltering>
                <explicit>false</explicit>
            </contentFiltering>
            <ns:timeZone>+02:00</ns:timeZone>
        </ns:context>
    </soap:Header>
    <soap:Body>
        <ns:getMetadata xmlns="http://www.sonos.com/Services/1.1">
            <id>theme:2b1bbc7b-288f-4a9d-8d5c-357631daaf11</id>
            <index>0</index>
            <count>100</count>
        </ns:getMetadata>
    </soap:Body>
</soap:Envelope>

<!-- Server responded -->

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:tns="http://www.sonos.com/Services/1.1">
    <soap:Body>
        <getMetadataResponse xmlns="http://www.sonos.com/Services/1.1">
            <index>0</index>
            <count>4</count>
            <total>4</total>
            <getMetadataResult>
                <mediaMetadata>
                    <id>code:1137d375-a5f3-4edf-b748-ee1e29e874b9</id>
                    <mimeType>audio/mpeg</mimeType>
                    <itemType>track</itemType>
                    <title>Ocean</title>
                    <trackMetadata>
                        <albumId>theme:2b1bbc7b-288f-4a9d-8d5c-357631daaf11</albumId>
                        <duration>516</duration>
                        <album>Receive</album>
                        <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                    </trackMetadata>
                </mediaMetadata>
                <mediaMetadata>
                    <id>code:b6b80cf3-6b6f-4907-b4dc-43b1a886153a</id>
                    <mimeType>audio/mpeg</mimeType>
                    <itemType>track</itemType>
                    <title>We’ve got you</title>
                    <trackMetadata>
                        <albumId>theme:2b1bbc7b-288f-4a9d-8d5c-357631daaf11</albumId>
                        <duration>466</duration>
                        <album>Receive</album>
                        <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                    </trackMetadata>
                </mediaMetadata>
                <mediaMetadata>
                    <id>code:75ab85f3-47dc-4e32-9bf2-28a1f0a675d3</id>
                    <mimeType>audio/mpeg</mimeType>
                    <itemType>track</itemType>
                    <title>Starlight</title>
                    <trackMetadata>
                        <albumId>theme:2b1bbc7b-288f-4a9d-8d5c-357631daaf11</albumId>
                        <duration>589</duration>
                        <album>Receive</album>
                        <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                    </trackMetadata>
                </mediaMetadata>
                <mediaMetadata>
                    <id>code:fb383f43-764b-42e3-aa28-39cd870314e7</id>
                    <mimeType>audio/mpeg</mimeType>
                    <itemType>track</itemType>
                    <title>Heart massage</title>
                    <trackMetadata>
                        <albumId>theme:2b1bbc7b-288f-4a9d-8d5c-357631daaf11</albumId>
                        <duration>552</duration>
                        <album>Receive</album>
                        <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                    </trackMetadata>
                </mediaMetadata>
            </getMetadataResult>
        </getMetadataResponse>
    </soap:Body>
</soap:Envelope>

<!-- Server received -->

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns="http://www.sonos.com/Services/1.1">
    <soap:Header>
        <credentials xmlns="http://www.sonos.com/Services/1.1">
            <deviceProvider>Sonos</deviceProvider>
        </credentials>
        <ns:context>
            <contentFiltering>
                <explicit>false</explicit>
            </contentFiltering>
            <ns:timeZone>+02:00</ns:timeZone>
        </ns:context>
    </soap:Header>
    <soap:Body>
        <ns:getExtendedMetadata xmlns="http://www.sonos.com/Services/1.1">
            <id>theme:2b1bbc7b-288f-4a9d-8d5c-357631daaf11</id>
        </ns:getExtendedMetadata>
    </soap:Body>
</soap:Envelope>

<!-- Server responded -->

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:tns="http://www.sonos.com/Services/1.1">
    <soap:Body>
        <getExtendedMetadataResponse xmlns="http://www.sonos.com/Services/1.1">
            <getExtendedMetadataResult>
                <mediaCollection>
                    <id>theme:2b1bbc7b-288f-4a9d-8d5c-357631daaf11</id>
                    <itemType>album</itemType>
                    <title>Receive</title>
                    <artist>SoundWheel</artist>
                    <artistId>soundwheel</artistId>
                    <canScroll>false</canScroll>
                    <canPlay>true</canPlay>
                    <canEnumerate>true</canEnumerate>
                    <canAddToFavorites>true</canAddToFavorites>
                    <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                </mediaCollection>
            </getExtendedMetadataResult>
        </getExtendedMetadataResponse>
    </soap:Body>
</soap:Envelope>

<!-- Server received -->

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns="http://www.sonos.com/Services/1.1">
    <soap:Header>
        <credentials xmlns="http://www.sonos.com/Services/1.1">
            <deviceProvider>Sonos</deviceProvider>
        </credentials>
        <ns:context>
            <contentFiltering>
                <explicit>false</explicit>
            </contentFiltering>
            <ns:timeZone>+02:00</ns:timeZone>
        </ns:context>
    </soap:Header>
    <soap:Body>
        <ns:getExtendedMetadata xmlns="http://www.sonos.com/Services/1.1">
            <id>code:1137d375-a5f3-4edf-b748-ee1e29e874b9</id>
        </ns:getExtendedMetadata>
    </soap:Body>
</soap:Envelope>

<!-- Server responded -->

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:tns="http://www.sonos.com/Services/1.1">
    <soap:Body>
        <getExtendedMetadataResponse xmlns="http://www.sonos.com/Services/1.1">
            <getExtendedMetadataResult>
                <mediaMetadata>
                    <id>code:1137d375-a5f3-4edf-b748-ee1e29e874b9</id>
                    <itemType>track</itemType>
                    <title>Ocean</title>
                    <mimeType>audio/mp3</mimeType>
                    <trackMetadata>
                        <artistId>soundwheel</artistId>
                        <artist>SoundWheel</artist>
                        <albumId>theme:2b1bbc7b-288f-4a9d-8d5c-357631daaf11</albumId>
                        <album>Receive</album>
                        <duration>516</duration>
                        <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                        <canSkip>true</canSkip>
                        <canAddToFavorites>true</canAddToFavorites>
                    </trackMetadata>
                </mediaMetadata>
            </getExtendedMetadataResult>
        </getExtendedMetadataResponse>
    </soap:Body>
</soap:Envelope>

<!-- Server received -->

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns="http://www.sonos.com/Services/1.1">
    <soap:Header>
        <credentials xmlns="http://www.sonos.com/Services/1.1">
            <deviceProvider>Sonos</deviceProvider>
        </credentials>
        <ns:context>
            <contentFiltering>
                <explicit>true</explicit>
            </contentFiltering>
        </ns:context>
    </soap:Header>
    <soap:Body>
        <ns:getExtendedMetadata xmlns="http://www.sonos.com/Services/1.1">
            <id>code:1137d375-a5f3-4edf-b748-ee1e29e874b9</id>
        </ns:getExtendedMetadata>
    </soap:Body>
</soap:Envelope>

<!-- Server responded -->

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:tns="http://www.sonos.com/Services/1.1">
    <soap:Body>
        <getExtendedMetadataResponse xmlns="http://www.sonos.com/Services/1.1">
            <getExtendedMetadataResult>
                <mediaMetadata>
                    <id>code:1137d375-a5f3-4edf-b748-ee1e29e874b9</id>
                    <itemType>track</itemType>
                    <title>Ocean</title>
                    <mimeType>audio/mp3</mimeType>
                    <trackMetadata>
                        <artistId>soundwheel</artistId>
                        <artist>SoundWheel</artist>
                        <albumId>theme:2b1bbc7b-288f-4a9d-8d5c-357631daaf11</albumId>
                        <album>Receive</album>
                        <duration>516</duration>
                        <albumArtURI>https://app.soundwheel.com/app.png</albumArtURI>
                        <canSkip>true</canSkip>
                        <canAddToFavorites>true</canAddToFavorites>
                    </trackMetadata>
                </mediaMetadata>
            </getExtendedMetadataResult>
        </getExtendedMetadataResponse>
    </soap:Body>
</soap:Envelope>

我的互动是这样的: https://www.hiveworkshop.com/data/video/448/448239-237aeb2d4efe893a0e304bc437c038db.mp4

除了

getMediaURI
从未被调用之外,奇怪的是发送了两次:


        <ns:getExtendedMetadata xmlns="http://www.sonos.com/Services/1.1">
            <id>code:1137d375-a5f3-4edf-b748-ee1e29e874b9</id>
        </ns:getExtendedMetadata>

好像我的回答不符合规范。但我检查了很多次,它看起来很适合我。

请告诉我为什么 Sonos 在名为

getMediaURI
的赛道上从不询问
Ocean
:)

soap sonos
1个回答
0
投票

SMAPI 安全文档说 TLS 1.2 是一项要求,并且当我通过 Synology NAS 反向代理我的 API 时,我不知道它只支持 1.3。允许 1.2 后,

getMediaURI
呼叫开始通过。

https://docs.sonos.com/docs/security#tag/playback/operation/Playback-LoadContent-GroupId

© www.soinside.com 2019 - 2024. All rights reserved.