API tweak: Add new parameter or new result fields to actual API endpoints
API extension: Add new API endpoints
Proposal description
There is currently no way to get the total count of artists/albums/tracks in the library other than requesting the entire list. We should expose a way for the clients to get this info either via tweaking existing APIs or adding new endpoints.
Backward compatibility impact
Can be done without breaking backward compatability, especially if done by adding new endpoint(s)
API details
This could be implemented either with new endpoints (getAlbumCount etc) or as an additional element e.g. <total-count>890</total-count> returned in the response payload for getArtists, getAlbumList2 etc. In the latter case, the client could call these endpoints with the size=0 option if they simply want to request the total count.
Security impacts
N/A
Potential issues
N/A
Alternative solutions
HTTP HEAD request instead of GET to return this info?
I’ll add to that as well to suggest an API for the client to know if a given album art image has been updated on the server. My client caches album covers locally, and for now it will never ask the server for the image again once it has a cached copy. But I want the image to be able to update if it’s changed on the server, without also spamming the server with requesting a new downscaled cover thumbnail every time it’s displayed.