The Subsonic API spec defines songCount and created as required attributes on AlbumID3, but they were tagged with omitempty in our response struct, allowing them to be silently dropped from responses (e.g. when songCount was 0). Created was also a *time.Time, which compounded the omitempty behavior. Remove omitempty from both fields and change Created from *time.Time to time.Time so they are always serialized, matching the spec contract that clients rely on. The buildAlbumID3 helper and its tests are updated for the non-pointer Created, and the AlbumWithSongsID3 snapshots are regenerated to include the now-always-present fields.
224 lines
4.7 KiB
JSON
224 lines
4.7 KiB
JSON
{
|
|
"status": "ok",
|
|
"version": "1.16.1",
|
|
"type": "navidrome",
|
|
"serverVersion": "v0.55.0",
|
|
"openSubsonic": true,
|
|
"album": {
|
|
"id": "1",
|
|
"name": "album",
|
|
"artist": "artist",
|
|
"songCount": 0,
|
|
"duration": 292,
|
|
"created": "0001-01-01T00:00:00Z",
|
|
"genre": "rock",
|
|
"userRating": 4,
|
|
"genres": [
|
|
{
|
|
"name": "rock"
|
|
},
|
|
{
|
|
"name": "progressive"
|
|
}
|
|
],
|
|
"musicBrainzId": "1234",
|
|
"isCompilation": true,
|
|
"sortName": "sorted album",
|
|
"discTitles": [
|
|
{
|
|
"disc": 1,
|
|
"title": "disc 1"
|
|
},
|
|
{
|
|
"disc": 2,
|
|
"title": "disc 2"
|
|
},
|
|
{
|
|
"disc": 3,
|
|
"title": ""
|
|
}
|
|
],
|
|
"originalReleaseDate": {
|
|
"year": 1994,
|
|
"month": 2,
|
|
"day": 4
|
|
},
|
|
"releaseDate": {
|
|
"year": 2000,
|
|
"month": 5,
|
|
"day": 10
|
|
},
|
|
"releaseTypes": [
|
|
"album",
|
|
"live"
|
|
],
|
|
"recordLabels": [
|
|
{
|
|
"name": "label1"
|
|
},
|
|
{
|
|
"name": "label2"
|
|
}
|
|
],
|
|
"moods": [
|
|
"happy",
|
|
"sad"
|
|
],
|
|
"artists": [
|
|
{
|
|
"id": "1",
|
|
"name": "artist1"
|
|
},
|
|
{
|
|
"id": "2",
|
|
"name": "artist2"
|
|
}
|
|
],
|
|
"displayArtist": "artist1 \u0026 artist2",
|
|
"explicitStatus": "clean",
|
|
"version": "Deluxe Edition",
|
|
"song": [
|
|
{
|
|
"id": "1",
|
|
"isDir": true,
|
|
"title": "title",
|
|
"album": "album",
|
|
"artist": "artist",
|
|
"track": 1,
|
|
"year": 1985,
|
|
"genre": "Rock",
|
|
"coverArt": "1",
|
|
"size": 8421341,
|
|
"contentType": "audio/flac",
|
|
"suffix": "flac",
|
|
"starred": "2016-03-02T20:30:00Z",
|
|
"transcodedContentType": "audio/mpeg",
|
|
"transcodedSuffix": "mp3",
|
|
"duration": 146,
|
|
"bitRate": 320,
|
|
"bpm": 127,
|
|
"comment": "a comment",
|
|
"sortName": "sorted song",
|
|
"mediaType": "song",
|
|
"musicBrainzId": "4321",
|
|
"isrc": [
|
|
"ISRC-1"
|
|
],
|
|
"genres": [
|
|
{
|
|
"name": "rock"
|
|
},
|
|
{
|
|
"name": "progressive"
|
|
}
|
|
],
|
|
"replayGain": {
|
|
"trackGain": 1,
|
|
"albumGain": 2,
|
|
"trackPeak": 3,
|
|
"albumPeak": 4,
|
|
"baseGain": 5,
|
|
"fallbackGain": 6
|
|
},
|
|
"channelCount": 2,
|
|
"samplingRate": 44100,
|
|
"bitDepth": 16,
|
|
"moods": [
|
|
"happy",
|
|
"sad"
|
|
],
|
|
"artists": [
|
|
{
|
|
"id": "1",
|
|
"name": "artist1"
|
|
},
|
|
{
|
|
"id": "2",
|
|
"name": "artist2"
|
|
}
|
|
],
|
|
"displayArtist": "artist1 \u0026 artist2",
|
|
"albumArtists": [
|
|
{
|
|
"id": "1",
|
|
"name": "album artist1"
|
|
},
|
|
{
|
|
"id": "2",
|
|
"name": "album artist2"
|
|
}
|
|
],
|
|
"displayAlbumArtist": "album artist1 \u0026 album artist2",
|
|
"contributors": [
|
|
{
|
|
"role": "role1",
|
|
"artist": {
|
|
"id": "1",
|
|
"name": "artist1"
|
|
}
|
|
},
|
|
{
|
|
"role": "role2",
|
|
"subRole": "subrole4",
|
|
"artist": {
|
|
"id": "2",
|
|
"name": "artist2"
|
|
}
|
|
}
|
|
],
|
|
"displayComposer": "composer 1 \u0026 composer 2",
|
|
"explicitStatus": "clean",
|
|
"groupings": [
|
|
"Soundtrack",
|
|
"Live"
|
|
]
|
|
},
|
|
{
|
|
"id": "2",
|
|
"isDir": true,
|
|
"title": "title",
|
|
"album": "album",
|
|
"artist": "artist",
|
|
"track": 1,
|
|
"year": 1985,
|
|
"genre": "Rock",
|
|
"coverArt": "1",
|
|
"size": 8421341,
|
|
"contentType": "audio/flac",
|
|
"suffix": "flac",
|
|
"starred": "2016-03-02T20:30:00Z",
|
|
"transcodedContentType": "audio/mpeg",
|
|
"transcodedSuffix": "mp3",
|
|
"duration": 146,
|
|
"bitRate": 320,
|
|
"bpm": 0,
|
|
"comment": "",
|
|
"sortName": "",
|
|
"mediaType": "",
|
|
"musicBrainzId": "",
|
|
"isrc": [],
|
|
"genres": [],
|
|
"replayGain": {
|
|
"trackGain": 0,
|
|
"albumGain": 0,
|
|
"trackPeak": 0,
|
|
"albumPeak": 0,
|
|
"baseGain": 0,
|
|
"fallbackGain": 0
|
|
},
|
|
"channelCount": 0,
|
|
"samplingRate": 0,
|
|
"bitDepth": 0,
|
|
"moods": [],
|
|
"artists": [],
|
|
"displayArtist": "",
|
|
"albumArtists": [],
|
|
"displayAlbumArtist": "",
|
|
"contributors": [],
|
|
"displayComposer": "",
|
|
"explicitStatus": "",
|
|
"groupings": []
|
|
}
|
|
]
|
|
}
|
|
}
|