Skip to content

Multi-valued fields

As discussed here: https://github.com/navidrome/navidrome/issues/211 The current subsonic API only supports one value for any metadata field name. This is limiting functionality since especially artist and genre often have multiple values in the tags.

Proposal

Three new elements would be added to the AlbumID3 and Child complexTypes: genres, artists and artistIDs which are all xs:sequence, so they can contain multiple values.

Any new multi-valued metadata fields that might get added to the API going forwards (say: mood, composer, conductor, remixer, lyricist, producer, etc) would be an xs:sequence from the start, this dual artist/artists thing is only for these existing fields.

Backwards/forwards compatibility:

  • old servers would return genre and artist, which is fine since the lists are are optional
  • new servers would send genre and artist (containing the first genre and first artist), as well as genres and artists lists
  • old clients would use the single-valued attributes and ignore these new lists
  • new clients use the lists, provided of course they can handle them

Alternatives (all up for discussion)

  • make artist an xs:sequence (breaks compatibility since it's currently xs:attribute)
  • define a separator character (semicolon, pipe), and return an xs:attribute like Kanye West;Jay-Z or Kanye West|Jay-Z as artist, and let the clients deal with parsing it. Downside: multiple values in one element is very un-XML, looks bad on legacy clients, and also creates edge cases for artists with the separator character in their name - this is exactly what happened when id3v2.3 defined the forward slash / as separator, and AC/DC ended up being split.
  • make artist name and artist ID parts of a 2-column artists list, not two separate xs:sequences

Something like:

<xs:element name="artists">
    <xs:sequence>
      <xs:element name="artist" type="sub:Artist" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
</xs:element> 
<xs:element name="genres">
    <xs:sequence>
      <xs:element name="genre" type="sub:Genre" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
</xs:element> 
Edited by certuna
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information