Ability to apply multiple filter criteria at once to album 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

Currently, the API only allows for applying one filter criteria at a time to getAlbumList2 (e.g. if you’re getting albums by genre you can’t additionally filter to within a specific year range, or sort by recently added).

The api should be tweaked, or a new API created, to allow multiple filters and a sort order to be applied simultaneously.

Backward compatibility impact

If this is done with a new getAlbumList3 endpoint, it is not a breaking change

API details

I propose either extending the getAlbumList2 endpoint, or likely creating a new getAlbumList3 endpoint, which allows for multiple filters and a sort order to be applied simultaneously. Server maintainers may want discussion over what exactly the API call should look like, but I think it should be basically the same as getAlbumList2 except you don’t need to set the type parameter to set any of the optional parameters (fromYear, toYear, genre).

For example, you could call getAlbumList3 with type=recent, fromYear=1990, toYear=2023, genre=rock, which would mean “get Rock albums from year 1990 through 2023, and sort the result by recently added”

Even better, the genre option could be changed to genres to allow the union of multiple genres

Security impacts

N/A

Potential issues

N/A

Alternative solutions


Proposal status

Proposed

Thanks for this proposal.
But again, what if we want “aggressive metal” albums? or “relaxed electronic” albums?
We want to specify both genre and mood tags (and possibly more):

  • do we want to specify a list of well known tags so that the server knows what to parse?
  • do we want to just add a “tags” parameter which is an array of {type, value}?

Should be something very related to the Expose additional data for media - #6 by Tolriq proposal

As said on another post we should never talk about tags but directly use the supported values with a common validated name.

Album artist tag is

  • “TPE2” for id3 or “TXXX/ALBUMARTIST” or “TXXX/ALBUM ARTIST”
  • “aART” or “----:com.apple.iTunes:MusicBrainz Album Artist” for mp4
  • “WM/AlbumArtist” for asf
  • And so on.

It’s the same for the ratings for example no one expose directly the “POPM” tag but a rational 1-5 or 1-10 rating that is derived from the tag and well known.

I did not mean to directly expose all the tags present the files, of course the server needs to homogenize this stuff.
Let’s first define these validated tags then. And as said on another post, I think artist roles may likely require to be treated separately from these tags.