Expose artistCount / albumCount etc without needing to retrieve entire list

Type of change

  • 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?

Proposal status

Proposed / In review / Accepted / Implemented

1 Like

Please read the rules of this forum before opening all this threads…

There’s formalism else it’s dead In a couple of days…

Edited to add template.

Thanks.

I would add to that a way to know the last edit time of the library for apps that do syncs.

1 Like

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.

Well this would be needed for every fields that can be edited too for offline sync.

Added a lastModified field to all data and allowing to query based on it would be real nice for my needs, but doubt many servers could do that.