I'm using some additional logic to skirt around this issue, but I've noticed reportPlaySeconds
being called regardless of the interval
value I return.
The Result documentation states:
interval string(128) - Number of seconds to elapse before next report. Note: A value of 0 indicates that no reporting after the start of playback of that track should be issued.
This is an example request request:
<?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:Header>
<ns1:credentials>
<ns1:deviceId>00-01-02-0A-0B-0C</ns1:deviceId>
<ns1:deviceProvider>Sonos</ns1:deviceProvider>
<ns1:sessionId>303-TEMP</ns1:sessionId>
</ns1:credentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:reportPlaySeconds>
<ns1:id>track_id</ns1:id>
<ns1:seconds>0</ns1:seconds>
</ns1:reportPlaySeconds>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
And the response:
<?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:reportPlaySecondsResponse>
<ns1:reportPlaySecondsResult>
<ns1:interval>0</ns1:interval>
</ns1:reportPlaySecondsResult>
</ns1:reportPlaySecondsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
If I've understood the documentation correctly, returning <ns1:interval>0</ns1:interval>
means reportPlaySeconds
shouldn't be called again. I'm also using setPlayedSeconds
to calculate more granular reporting, so additional reportPlaySeconds
calls are unnecessary.
Any ideas?