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

Subsonic API returns an array instead of a single object with user details. #3932

Open
4WaYDp opened this issue Apr 15, 2024 · 2 comments
Open

Comments

@4WaYDp
Copy link

4WaYDp commented Apr 15, 2024

Description

I just installed Ampache and tried to connect Play:Sub through the Subsonic API. Play:Sub would always crash after the getUser.view call.

Describe the bug

Subsonic API returns an array for user in the getUser.view call. This should not be an array because it will always return one (current) user. Play:Sub crashes on this at startup.

To reproduce

{
"subsonic-response": {
"status": "ok",
"version": "1.16.1",
"type": "ampache",
"serverVersion": "6.3.1",
"user": [
{
"username": "test",
"email": "test@test.eu",
"scrobblingEnabled": true,
"adminRole": false,
"settingsRole": true,
"downloadRole": false,
"playlistRole": true,
"coverArtRole": false,
"commentRole": false,
"podcastRole": true,
"streamRole": true,
"jukeboxRole": false,
"shareRole": true,
"videoConversionRole": false
}
]
}
}

Expected behavior

{
"subsonic-response": {
"status": "ok",
"version": "1.16.1",
"type": "ampache",
"serverVersion": "6.3.1",
"user": {
"username": "test",
"email": "test@test.eu",
"scrobblingEnabled": true,
"adminRole": false,
"settingsRole": true,
"downloadRole": false,
"playlistRole": true,
"coverArtRole": false,
"commentRole": false,
"podcastRole": true,
"streamRole": true,
"jukeboxRole": false,
"shareRole": true,
"videoConversionRole": false
}
}
}

Environment

  • Ampache-docker version: 6.3.1
  • Web server + version: NGINX 1.24.0
  • Server operating system: Ubuntu 5.15.0-102-generic
  • Client operating system: iOS 17.4.1

Client type

  • SubSonic: Play:Sub v2023.2

Possible solution

I changed line 132 in src/Module/Api/Subsonic_Api.php from 'user' to 'users'. I believe that 'users' should be an ALWAYS_ARRAY. Play:Sub now connects correctly and does not crash anymore.

@lachlan-00
Copy link
Member

You're right, i can see that in the spec. i'll fix now

image

@lachlan-00
Copy link
Member

set with 73106a9 i'll be doing a 6.4 release soon with a lot of fixes in there

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

No branches or pull requests

2 participants