2011-03-04, 12:39
I think there is something fishy with the 'total' field returned from AudioLibrary.GetAlbums()
When i use AudioLibrary.GetArtists({'start': 0, 'end': 5}) the 'total' returned is the total number of artists in the library, same goes for songs, if i use AudioLibrary.GetSongs({'start': 0, 'end': 5, 'artistid': 2}) the 'total' is the total tracks i have for the artist with id 2. This is all good and expected behaviour.
However if i use AudioLibrary.GetAlbums({'start': 0, 'end': 5}) the 'total' is always the same as 'end'. This is not so juicy and makes it hard to page through results as the client can't know when there are more pages available.
The workaround for me was to first query the server with AudioLibrary.GetAlbums('start': 0, 'end': 0) as this returns the true number of albums in the library but in doing that i discovered that when you send {'start': 0, 'end': 0, 'artistid': 2} you still get the total number of albums in the library, not the number of albums for artist with id 2.
stumped.
When i use AudioLibrary.GetArtists({'start': 0, 'end': 5}) the 'total' returned is the total number of artists in the library, same goes for songs, if i use AudioLibrary.GetSongs({'start': 0, 'end': 5, 'artistid': 2}) the 'total' is the total tracks i have for the artist with id 2. This is all good and expected behaviour.
However if i use AudioLibrary.GetAlbums({'start': 0, 'end': 5}) the 'total' is always the same as 'end'. This is not so juicy and makes it hard to page through results as the client can't know when there are more pages available.
The workaround for me was to first query the server with AudioLibrary.GetAlbums('start': 0, 'end': 0) as this returns the true number of albums in the library but in doing that i discovered that when you send {'start': 0, 'end': 0, 'artistid': 2} you still get the total number of albums in the library, not the number of albums for artist with id 2.
stumped.