API getAlbum - not returning song list

Need help? Post your questions here.

Moderator: moderators

API getAlbum - not returning song list

Postby Azkatro » Tue Sep 17, 2019 1:05 am

I'm encountering a problem with the API where I'm not getting any songs coming back in my calls to getAlbum. I'm connecting to a MySQL database.

However, when I access the album through the Subsonic web player and refresh the API call, the songs appear.

For example, here is a "before":

Code: Select all
{
   "subsonic-response" : {
      "status" : "ok",
      "version" : "1.16.1",
      "album" : {
         "id" : "188",
         "name" : "Fireball ( '96 Aniversary Editon )",
         "artist" : "Deep Purple",
         "artistId" : "61",
         "coverArt" : "al-188",
         "songCount" : 15,
         "duration" : 4342,
         "playCount" : 0,
         "created" : "2019-08-01T00:03:13.000Z",
         "year" : 1971,
         "genre" : "Classic Hard Rock"
      }
   }
}


After searching for and clicking on that exact album in the web player, which brings up the cover art and track list, the same API call as above gives me this:

Code: Select all
{
   "subsonic-response" : {
      "status" : "ok",
      "version" : "1.16.1",
      "album" : {
         "id" : "188",
         "name" : "Fireball ( '96 Aniversary Editon )",
         "artist" : "Deep Purple",
         "artistId" : "61",
         "coverArt" : "al-188",
         "songCount" : 15,
         "duration" : 4342,
         "playCount" : 0,
         "created" : "2019-08-01T00:03:13.000Z",
         "year" : 1971,
         "genre" : "Classic Hard Rock",
         "song" : [ {
            "id" : "3012",
            "parent" : "189",
            "isDir" : false,
            "title" : "Fireball",
            "album" : "Fireball ( '96 Aniversary Editon )",
            "artist" : "Deep Purple",
            "track" : 1,
            "year" : 1971,
            "genre" : "Classic Hard Rock",
            "coverArt" : "189",
            "size" : 21924568,
            "contentType" : "audio/flac",
            "suffix" : "flac",
            "transcodedContentType" : "audio/ogg",
            "transcodedSuffix" : "ogg",
            "duration" : 205,
            "bitRate" : 854,
            "path" : "Deep Purple - 1971 - Fireball (25th Anniversary Edition)/01 Fireball.flac",
            "playCount" : 0,
            "created" : "2019-08-01T00:03:13.000Z",
            "albumId" : "188",
            "artistId" : "61",
            "type" : "music"
         }, {
            "id" : "3013",
            "parent" : "189",
            "isDir" : false,
            "title" : "No No No",
            "album" : "Fireball ( '96 Aniversary Editon )",
            "artist" : "Deep Purple",
            "track" : 2,
            "year" : 1971,
            "genre" : "Classic Hard Rock",
            "coverArt" : "189",
            "size" : 43928081,
            "contentType" : "audio/flac",
            "suffix" : "flac",
            "transcodedContentType" : "audio/ogg",
            "transcodedSuffix" : "ogg",
            "duration" : 414,
            "bitRate" : 848,
            "path" : "Deep Purple - 1971 - Fireball (25th Anniversary Edition)/02 No No No.flac",
            "playCount" : 0,
            "created" : "2019-08-01T00:03:13.000Z",
            "albumId" : "188",
            "artistId" : "61",
            "type" : "music"
         }, {
            "id" : "3014",
            "parent" : "189",
            "isDir" : false,
            "title" : "Demon's Eye",
            "album" : "Fireball ( '96 Aniversary Editon )",
            "artist" : "Deep Purple",
            "track" : 3,
            "year" : 1971,
            "genre" : "Classic Hard Rock",
            "coverArt" : "189",
            "size" : 34323693,
            "contentType" : "audio/flac",
            "suffix" : "flac",
            "transcodedContentType" : "audio/ogg",
            "transcodedSuffix" : "ogg",
            "duration" : 321,
            "bitRate" : 854,
            "path" : "Deep Purple - 1971 - Fireball (25th Anniversary Edition)/03 Demon's Eye.flac",
            "playCount" : 0,
            "created" : "2019-08-01T00:03:13.000Z",
            "albumId" : "188",
            "artistId" : "61",
            "type" : "music"
         }, {
            "id" : "3015",
            "parent" : "189",
            "isDir" : false,
            "title" : "Anyone's Daughter",
            "album" : "Fireball ( '96 Aniversary Editon )",
            "artist" : "Deep Purple",
            "track" : 4,
            "year" : 1971,
            "genre" : "Classic Hard Rock",
            "coverArt" : "189",
            "size" : 25473588,
            "contentType" : "audio/flac",
            "suffix" : "flac",
            "transcodedContentType" : "audio/ogg",
            "transcodedSuffix" : "ogg",
            "duration" : 283,
            "bitRate" : 719,
            "path" : "Deep Purple - 1971 - Fireball (25th Anniversary Edition)/04 Anyone's Daughter.flac",
            "playCount" : 0,
            "created" : "2019-08-01T00:03:13.000Z",
            "albumId" : "188",
            "artistId" : "61",
            "type" : "music"
         }, {
            "id" : "3016",
            "parent" : "189",
            "isDir" : false,
            "title" : "The Mule",
            "album" : "Fireball ( '96 Aniversary Editon )",
            "artist" : "Deep Purple",
            "track" : 5,
            "year" : 1971,
            "genre" : "Classic Hard Rock",
            "coverArt" : "189",
            "size" : 35356987,
            "contentType" : "audio/flac",
            "suffix" : "flac",
            "transcodedContentType" : "audio/ogg",
            "transcodedSuffix" : "ogg",
            "duration" : 321,
            "bitRate" : 879,
            "path" : "Deep Purple - 1971 - Fireball (25th Anniversary Edition)/05 The Mule.flac",
            "playCount" : 0,
            "created" : "2019-08-01T00:03:13.000Z",
            "albumId" : "188",
            "artistId" : "61",
            "type" : "music"
         }, {
            "id" : "3017",
            "parent" : "189",
            "isDir" : false,
            "title" : "Fools",
            "album" : "Fireball ( '96 Aniversary Editon )",
            "artist" : "Deep Purple",
            "track" : 6,
            "year" : 1971,
            "genre" : "Classic Hard Rock",
            "coverArt" : "189",
            "size" : 52279107,
            "contentType" : "audio/flac",
            "suffix" : "flac",
            "transcodedContentType" : "audio/ogg",
            "transcodedSuffix" : "ogg",
            "duration" : 499,
            "bitRate" : 838,
            "path" : "Deep Purple - 1971 - Fireball (25th Anniversary Edition)/06 Fools.flac",
            "playCount" : 0,
            "created" : "2019-08-01T00:03:13.000Z",
            "albumId" : "188",
            "artistId" : "61",
            "type" : "music"
         }, {
            "id" : "3018",
            "parent" : "189",
            "isDir" : false,
            "title" : "No One Came",
            "album" : "Fireball ( '96 Aniversary Editon )",
            "artist" : "Deep Purple",
            "track" : 7,
            "year" : 1971,
            "genre" : "Classic Hard Rock",
            "coverArt" : "189",
            "size" : 41600822,
            "contentType" : "audio/flac",
            "suffix" : "flac",
            "transcodedContentType" : "audio/ogg",
            "transcodedSuffix" : "ogg",
            "duration" : 386,
            "bitRate" : 861,
            "path" : "Deep Purple - 1971 - Fireball (25th Anniversary Edition)/07 No One Came.flac",
            "playCount" : 0,
            "created" : "2019-08-01T00:03:13.000Z",
            "albumId" : "188",
            "artistId" : "61",
            "type" : "music"
         }, {
            "id" : "3019",
            "parent" : "189",
            "isDir" : false,
            "title" : "Strange Kind Of Woman ( A-Side Remix '96 )",
            "album" : "Fireball ( '96 Aniversary Editon )",
            "artist" : "Deep Purple",
            "track" : 8,
            "year" : 1971,
            "genre" : "Classic Hard Rock",
            "coverArt" : "189",
            "size" : 29775278,
            "contentType" : "audio/flac",
            "suffix" : "flac",
            "transcodedContentType" : "audio/ogg",
            "transcodedSuffix" : "ogg",
            "duration" : 246,
            "bitRate" : 969,
            "path" : "Deep Purple - 1971 - Fireball (25th Anniversary Edition)/08 Strange Kind Of Woman (A-Side Remix 1996).flac",
            "playCount" : 0,
            "created" : "2019-08-01T00:03:13.000Z",
            "albumId" : "188",
            "artistId" : "61",
            "type" : "music"
         }, {
            "id" : "3020",
            "parent" : "189",
            "isDir" : false,
            "title" : "I'm Alone ( B-Side )",
            "album" : "Fireball ( '96 Aniversary Editon )",
            "artist" : "Deep Purple",
            "track" : 9,
            "year" : 1971,
            "genre" : "Classic Hard Rock",
            "coverArt" : "189",
            "size" : 20525346,
            "contentType" : "audio/flac",
            "suffix" : "flac",
            "transcodedContentType" : "audio/ogg",
            "transcodedSuffix" : "ogg",
            "duration" : 187,
            "bitRate" : 875,
            "path" : "Deep Purple - 1971 - Fireball (25th Anniversary Edition)/09 I'm Alone (B-Side).flac",
            "playCount" : 0,
            "created" : "2019-08-01T00:03:13.000Z",
            "albumId" : "188",
            "artistId" : "61",
            "type" : "music"
         }, {
            "id" : "3021",
            "parent" : "189",
            "isDir" : false,
            "title" : "Freedom ( Album Out-Take )",
            "album" : "Fireball ( '96 Aniversary Editon )",
            "artist" : "Deep Purple",
            "track" : 10,
            "year" : 1971,
            "genre" : "Classic Hard Rock",
            "coverArt" : "189",
            "size" : 25838430,
            "contentType" : "audio/flac",
            "suffix" : "flac",
            "transcodedContentType" : "audio/ogg",
            "transcodedSuffix" : "ogg",
            "duration" : 215,
            "bitRate" : 962,
            "path" : "Deep Purple - 1971 - Fireball (25th Anniversary Edition)/10 Freedom (Album Outtake).flac",
            "playCount" : 0,
            "created" : "2019-08-01T00:03:13.000Z",
            "albumId" : "188",
            "artistId" : "61",
            "type" : "music"
         }, {
            "id" : "3022",
            "parent" : "189",
            "isDir" : false,
            "title" : "Train ( Album Out-Take )",
            "album" : "Fireball ( '96 Aniversary Editon )",
            "artist" : "Deep Purple",
            "track" : 11,
            "year" : 1971,
            "genre" : "Classic Hard Rock",
            "coverArt" : "189",
            "size" : 41689864,
            "contentType" : "audio/flac",
            "suffix" : "flac",
            "transcodedContentType" : "audio/ogg",
            "transcodedSuffix" : "ogg",
            "duration" : 336,
            "bitRate" : 992,
            "path" : "Deep Purple - 1971 - Fireball (25th Anniversary Edition)/11 Slow Train (Album Outtake).flac",
            "playCount" : 0,
            "created" : "2019-08-01T00:03:13.000Z",
            "albumId" : "188",
            "artistId" : "61",
            "type" : "music"
         }, {
            "id" : "3023",
            "parent" : "189",
            "isDir" : false,
            "title" : "Demon's Eye ( Remix '96 )",
            "album" : "Fireball ( '96 Aniversary Editon )",
            "artist" : "Deep Purple",
            "track" : 12,
            "year" : 1971,
            "genre" : "Classic Hard Rock",
            "coverArt" : "189",
            "size" : 42127399,
            "contentType" : "audio/flac",
            "suffix" : "flac",
            "transcodedContentType" : "audio/ogg",
            "transcodedSuffix" : "ogg",
            "duration" : 370,
            "bitRate" : 909,
            "path" : "Deep Purple - 1971 - Fireball (25th Anniversary Edition)/12 Demon's Eye (Remix 1996).flac",
            "playCount" : 0,
            "created" : "2019-08-01T00:03:13.000Z",
            "albumId" : "188",
            "artistId" : "61",
            "type" : "music"
         }, {
            "id" : "3024",
            "parent" : "189",
            "isDir" : false,
            "title" : "The Noise Abatement Sceity Tapes",
            "album" : "Fireball ( '96 Aniversary Editon )",
            "artist" : "Deep Purple",
            "track" : 13,
            "year" : 1971,
            "genre" : "Classic Hard Rock",
            "coverArt" : "189",
            "size" : 20962448,
            "contentType" : "audio/flac",
            "suffix" : "flac",
            "transcodedContentType" : "audio/ogg",
            "transcodedSuffix" : "ogg",
            "duration" : 256,
            "bitRate" : 654,
            "path" : "Deep Purple - 1971 - Fireball (25th Anniversary Edition)/13 The Noise Abatement Society Tapes.flac",
            "playCount" : 0,
            "created" : "2019-08-01T00:03:12.000Z",
            "albumId" : "188",
            "artistId" : "61",
            "type" : "music"
         }, {
            "id" : "3025",
            "parent" : "189",
            "isDir" : false,
            "title" : "Fireball Take 1 ( Instrumental )",
            "album" : "Fireball ( '96 Aniversary Editon )",
            "artist" : "Deep Purple",
            "track" : 14,
            "year" : 1971,
            "genre" : "Classic Hard Rock",
            "coverArt" : "189",
            "size" : 28647339,
            "contentType" : "audio/flac",
            "suffix" : "flac",
            "transcodedContentType" : "audio/ogg",
            "transcodedSuffix" : "ogg",
            "duration" : 248,
            "bitRate" : 924,
            "path" : "Deep Purple - 1971 - Fireball (25th Anniversary Edition)/14 Fireball (Take 1 - Instrumental).flac",
            "playCount" : 0,
            "created" : "2019-08-01T00:03:13.000Z",
            "albumId" : "188",
            "artistId" : "61",
            "type" : "music"
         }, {
            "id" : "3026",
            "parent" : "189",
            "isDir" : false,
            "title" : "Backwards Piano",
            "album" : "Fireball ( '96 Aniversary Editon )",
            "artist" : "Deep Purple",
            "track" : 15,
            "year" : 1971,
            "genre" : "Classic Hard Rock",
            "coverArt" : "189",
            "size" : 3925309,
            "contentType" : "audio/flac",
            "suffix" : "flac",
            "transcodedContentType" : "audio/ogg",
            "transcodedSuffix" : "ogg",
            "duration" : 55,
            "bitRate" : 572,
            "path" : "Deep Purple - 1971 - Fireball (25th Anniversary Edition)/15 Backwards Piano.flac",
            "playCount" : 0,
            "created" : "2019-08-01T00:03:12.000Z",
            "albumId" : "188",
            "artistId" : "61",
            "type" : "music"
         } ]
      }
   }
}


Any ideas how I can make sure I'm getting the song list on my getAlbum call without having to like.. manually do something to get it to appear?
Azkatro
 
Posts: 9
Joined: Thu Sep 05, 2019 3:01 am

Re: API getAlbum - not returning song list

Postby tyral » Wed Sep 18, 2019 6:20 am

Hmm, seeing as I've had my library since 2016 I can't say that I can try to replicate this, but it looks like maybe it's not making the database associations for those entries until they're loaded into the web UI or called some other way. I'm also using MySQL as my backend database and doing some neat things with the last_played field right now, but looking to utilize the API directly instead of trying to map the database schema to make sure my modifications are inline.

Do you have Fast Access mode on and do you do scheduled scans of your media folders?

Have you tried calling a getSong ( http://www.subsonic.org/pages/api.jsp#getSong ) on one of the songs on an album exhibiting this, and then call getAlbum again? I'm curious if that would have any effect. I'll do some testing when I get some time in the next couple days and see if I can replicate this.
tyral
 
Posts: 8
Joined: Fri Mar 24, 2017 8:48 pm

Re: API getAlbum - not returning song list

Postby Azkatro » Wed Sep 18, 2019 11:48 pm

Thanks for responding!

tyral wrote:Do you have Fast Access mode on and do you do scheduled scans of your media folders?


Fast Access mode is disabled, and scheduled scans are running once a day.

tyral wrote:Have you tried calling a getSong ( http://www.subsonic.org/pages/api.jsp#getSong ) on one of the songs on an album exhibiting this, and then call getAlbum again? I'm curious if that would have any effect. I'll do some testing when I get some time in the next couple days and see if I can replicate this.


Sure thing. I just gave it a try.

- Switched back to MySQL (been working off HSQLDB in the interim)
- Called getAlbum and confirmed it only returned the album info with no songs
- Checked the media_file db table directly in MySQL (via phpMyAdmin) and found one of the songs on the same album, noting the ID
- Called getSong passing in the idea
- Went back to the original getAlbum call and refreshed

The result was - no change. Unfortunately it didn't trigger the song list.

I then logged into the Subsonic web interface, and browsed my way to the album in question. Each step of the way, I refreshed the getAlbum call in the other browser tab to keep an eye on it. The list of songs didn't appear in the response until I took the finally clicked on the album itself in Subsonic. So whatever is happening when the Subsonic web interface loads the album itself for display is triggering the list of songs to be included in the API getAlbum call.
Azkatro
 
Posts: 9
Joined: Thu Sep 05, 2019 3:01 am

Re: API getAlbum - not returning song list

Postby Azkatro » Wed Sep 18, 2019 11:50 pm

Just for completeness' sake, by the way - I tried the above steps again (with a different album this time) with Fast Access mode enabled, and got the same result.
Azkatro
 
Posts: 9
Joined: Thu Sep 05, 2019 3:01 am


Return to Help

Who is online

Users browsing this forum: No registered users and 10 guests