Sonos character limits

Before Christmas I received an email alerting me to Sonos's metadata limits. Sonos's limitation of a maximum of 65,000 tracks is fairly well known, but this limitation goes deeper: it affects how many characters for each field of metadata are saved and displayed for tracks in your library.

A great example of musical metadata this can affect was given by the author: Illinois. Some of the track names are extremely long, and thus appear truncated in the Sonos.

The email went on to ask:

I don't know if bliss can be customised to run to either warn users e.g. mark it as non-compliant? That would be best.

Or probably easier just to truncate tracks to these lengths (not so good as the user doesn't know what's been done and then).

If so, I'd be interested to hear how to do this - and in doing so may extend my knowledge of bliss and how to get the most out of it.

This is certainly achievable using bliss's custom rules feature. And it's a bit more useful than my last example.

As usual, regex rules are created in the .bliss/regex-rules folder. Due to limitations about how rules are currently structured, I created one rule for each field listed on the Sonos page:

These rules simply look for fields which are longer than the prescribed limits, and offer a fix to truncate those fields. With the above files saved in our regex-rules folder, we can see in the settings:

Enabling the Sonos character limits

Once those rules are applied, Illinois gets assessed:

Illinois's long track lengths assessed and a one-click fix offered

Clicking Set TRACK_NAME to 100 chars will truncate the track name.

I suppose some shortcomings of how custom rules currently work are exposed:

  • It's hard to see all of the fixes that will be applied for track names.
  • The settings UI could be better laid out and structured.

Plus there's the requirement to understand regular expressions of course... All stuff to work on!

If you don't want a plain truncation of the string, something prettier would be to truncate and have an ellipsis at the end - "…". Because I'm not sure if the Sonos controller supports ellipsis, we can just use three periods instead. Here's that variation applied to the track name rule:

The same approach could be applied to the other tags.

An interesting application of custom rules!

Thanks to Upupa4me for the image above.
tags: sonos custom rule regex

The Music Library Management blog

Dan Gravell

I'm Dan, the founder and programmer of bliss. I write bliss to solve my own problems with my digital music collection.