svrooij / node-sonos-ts

:speaker: Sonos control library, use this library in your own appliction.
https://sonos-ts.svrooij.io/
MIT License
84 stars 18 forks source link

Version 3.6.0 beta0007 decodes embedded XML #190

Closed hklages closed 7 months ago

hklages commented 9 months ago

What happened

tsPlayer.ContentDirectoryService.Browse({ 'ObjectID': 'FV:2', 'BrowseFlag': 'BrowseDirectChildren', 'Filter': '*', 'StartingIndex': 0, 'RequestedCount': REQUESTED_COUNT_MYSONOS, 'SortCriteria': '' })

provides now a different output for property "Result" (it is decoded)) beta.7 "<DIDL-Lite xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:upnp beta.5 "<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=

What did you expect to happen

same output as beta 5

How to reproduce it (minimal and precise)

Add some items to MySonos with the help of the SONOS APP and use the above command

Environment

svrooij commented 9 months ago

The change has to to with the change in the used xml library, please check out this discussion where I tried explaining the decision. I cannot go back on this.

For you no longer being able to read that data, this is exactly where this code is for. It should parse the response from the Browse command, I modified the XmlHelper to only decode if it is even encoded. So this code should work as expected.

sonos.ContentDirectoryService.BrowseParsed({...});
hklages commented 8 months ago

... Next week I am going to work on it.

On Tue, Feb 13, 2024, 16:18 Stephan van Rooij @.***> wrote:

The change has to to with the change in the used xml library, please check out this discussion https://github.com/svrooij/node-sonos-ts/discussions/191 where I tried explaining the decision.

For you no longer being able to read that data, this is exactly where this code https://github.com/svrooij/node-sonos-ts/blob/981226514c45a24a9d36213a6be0aa882ec3a874/src/services/content-directory.service.extension.ts#L18-L38 is for. It should parse the response from the Browse command, but I guess it's broken as well.

I will fix this code for you, are you ok with that solution?

sonos.ContentDirectoryService.BrowseParsed({...});

— Reply to this email directly, view it on GitHub https://github.com/svrooij/node-sonos-ts/issues/190#issuecomment-1941763464, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDZCH3ZLCVDELUNVPYMMULYTN75BAVCNFSM6AAAAABDGQ5O72VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBRG43DGNBWGQ . You are receiving this because you authored the thread.Message ID: @.***>