Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed XML validation error with C# like clients like MusicBee #970

Closed
wants to merge 2 commits into from

Conversation

rstefko
Copy link
Contributor

@rstefko rstefko commented Apr 29, 2022

No description provided.

@paulijar
Copy link
Collaborator

paulijar commented May 2, 2022

Thanks for the PR. However, I would suggest a small modification: This now adds the xmlns property also in case the API response is requested in JSON format. This makes little sense and is not how the "real" Subsonic server works; this can be observed with the Subsonic demo server by requesting e.g. http://demo.subsonic.org/rest/getIndexes.view?u=guest4&c=Test&f=json&v=1.13.0&p=guest.

So the correct place to add the xmlns attribute would be above this line:

$response = new XmlResponse($responseData, $useAttributes);

There, it should be of course written like this: $responseData['subsonic-response']['xmlns'] = 'http://subsonic.org/restapi';.

Furthermore, the attribute xmlns should be added to this array:

$useAttributes = \array_merge($useAttributes, ['status', 'version']);

This ensures that the xmlns is always treated as an attribute, even on those few responses where the other key-value pairs are treated as child elements.

@scrutinizer-notifier
Copy link

The inspection completed: No new issues

@paulijar
Copy link
Collaborator

paulijar commented May 4, 2022

Great, thanks. I rebased and merged this manually, so I'm just going to close this PR.

Btw, does the connection between MusicBee and ownCloud Music work properly for you after this change? Because for me, this change does help me to get a bit further than before, but then the MusicBee Subsonic plugin gets stuck in the phase "Running GetMusicFolders". I wonder if there is also some other problem in our Subsonic API implementation or if there is just some property in my library specifically which reveals an issue on MusicBee.

@paulijar paulijar closed this May 4, 2022
@rstefko
Copy link
Contributor Author

rstefko commented May 5, 2022

The MusicBee plugin relies on path attribute which is not supported by ownCloud music. But as I was looking into the code, it feels like it is better to make changes in the MusicBee plugin: BlitterStudio/MB_SubSonic#66

@paulijar
Copy link
Collaborator

paulijar commented May 8, 2022

This is now released in Music v1.5.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants