Broken Subsonic API Compatibility
I've noticed an issue in the Funkwhale API which breaks support with some Android clients such as Ultrasonic.
The problem is that the contentType
field is set to null
.
Here is an example response from the Funkwhale API:
{
"subsonic-response": {
"album": {
"artist": "Ed Sheeran",
"artistId": 193,
"created": "2019-05-13T13:10:53.433548Z",
"id": 240,
"name": "+",
"song": [
{
"album": "+",
"albumId": 240,
"artist": "Ed Sheeran",
"artistId": 193,
"bitrate": 760,
"contentType": null,
"created": "2019-05-13T13:10:53.454154Z",
"discNumber": 1,
"duration": 261,
"id": 1170,
"isDir": "false",
"size": 24825028,
"suffix": "flac",
"title": "The A Team",
"track": 1,
"type": "music",
"year": 2011
},
...
This makes Ultrasonic crash with the following error:
Got exception: com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild] value failed for JSON property contentType due to missing (therefore NULL) value for creator parameter contentType which is a non-nullable type
at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 617] (through reference chain: org.moire.ultrasonic.api.subsonic.response.GetAlbumResponse["album"]->org.moire.ultrasonic.api.subsonic.models.Album["song"]->java.util.ArrayList[0]->org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild["contentType"])
com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild] value failed for JSON property contentType due to missing (therefore NULL) value for creator parameter contentType which is a non-nullable type
at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 617] (through reference chain: org.moire.ultrasonic.api.subsonic.response.GetAlbumResponse["album"]->org.moire.ultrasonic.api.subsonic.models.Album["song"]->java.util.ArrayList[0]->org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild["contentType"])
at com.fasterxml.jackson.module.kotlin.KotlinValueInstantiator.createFromObjectWith(KotlinValueInstantiator.kt:54)
Here are the software versions on which I am experiencing the problem:
Software | Version |
---|---|
Funkwhale | 0.19.1 |
D-Sub | 5.0.3 |
Ultrasonic | 2.6.1 |
Edited by Niccolò