Mp3tag version 3.23 - json_select_many function (continued)

Many thanks for the detailed bug report. It's really so very helpful to have this detailed description accompanied by a script and data to test with. Thank you!

I've analyzed the issue and it's related to a certain — until now undocumented — requirement by Mp3tag's internal tokenizer which splits a string using | as delimiters into its separate parts. It always expects a trailing delimiter character and if not present, adds it by itself.

Something like
Explicit|Explicit|Explicit|Explicit
becomes
Explicit|Explicit|Explicit|Explicit|
internally and is split into the four parts.

If the last value is the empty string and the provided output is
Explicit|Explicit|Explicit|
the required trailing pipe symbol is already present and the string is split in three parts. The fourth track uses the original value, because there is no dedicated value for this track.

If you want to make sure, that a trailing empty element is always identified as such, you can simply use a trailing delimiter character in all cases, e.g., add
Say "|"
so the result would be
Explicit|Explicit|Explicit||

This string has the trailing delimiter character expected by the tokenizer and is split in four parts. The last part is the an empty element.

I should have added this to the documentation long ago, a negligence which I've now corrected:

For fields that have varying contents for tracks, e.g., TITLE, TRACK, or ISRC, Mp3tag expects the output buffer to contain the individual values separated and finalized by the pipe character |, e.g., Title 1|Title 2|Title 3|.

Thanks again for your detailed and helpful report!

1 Like