Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate multiple values of imported ID3v2.4 compliant mp3 tags #759

Closed
ghlupe2 opened this issue Mar 26, 2020 · 11 comments
Closed

Separate multiple values of imported ID3v2.4 compliant mp3 tags #759

ghlupe2 opened this issue Mar 26, 2020 · 11 comments

Comments

@ghlupe2
Copy link
Contributor

ghlupe2 commented Mar 26, 2020

According to http://id3.org/id3v2.4.0-frames ID3v2.4 uses the null character to separate multiple values, which are allowed for all text information frames (tags beginning with T like TEP1 and TCOM).

TIPL (involved people list) and TMCL (musician credits list) are special cases. Every odd value is a role (instrument, voice, function) and every even is a person or a comma delimited list of persons.

Currently Gerbera replaces the null character with a space character which makes it hard to generate a list of values (which frequently contain blanks) using import.js.

Following elmodaddyb #401 (comment) I inserted into the addaudio function of import.js this code for printing all imported data:


 for (var metaProp in obj.meta) {
    print(metaProp + '--->' + obj.meta[metaProp]);
  }
 for (var auxProp in obj.aux) {
    print(auxProp + '--->' + obj.aux[auxProp]);
  }
 for (var resProp in obj.res) {
    print(resProp + '--->' + obj.res[resProp]);
  }

for the attached sample mp3 file resulting in:

JS: dc:title--->Come Together
JS: upnp:artist--->The Beatles
JS: upnp:album--->Abbey Road
JS: dc:date--->1969-09-26
JS: upnp:originalTrackNumber--->1
JS: upnp:artist@role[AlbumArtist]--->The Beatles
JS: TMCL--->electric guitar George Harrison electric guitar, electric piano and handclaps John Lennon electric bass guitar Paul McCartney drums (drum set) and maracas Ringo Starr background vocals and lead vocals John Lennon lead vocals John Lennon background vocals Paul McCartney
JS: TXXX:WORK--->WORK Come Together
JS: TXXX:Writer--->Writer John Lennon Paul McCartney
JS: TPUB--->Apple Records
JS: TXXX:MusicBrainz Album Type--->MusicBrainz Album Type album
JS: protocolInfo--->http-get:*:audio/mpeg:*
JS: size--->628930
JS: bitrate--->20935
JS: duration--->00:00:30.0
JS: sampleFrequency--->44100
JS: nrAudioChannels--->2

Using "|" as a separator string, TMCL should be: electric guitar|George Harrison|electric guitar, electric piano and handclaps|John Lennon|electric bass guitar|Paul McCartney|drums (drum set) and maracas|Ringo Starr|background vocals and lead vocals|John Lennon|lead vocals|John Lennon|background vocals|Paul McCartney and TXXX:Writer: John Lennon|Paul McCartney

I'd like to suggest a new content import option in config.xml, like

<multiple-values separate-multiple="no|yes" multi-separator="[separator string]"/>

in order to maintain compatibility with the current behaviour.

Audio file downloaded from archive.org, tagged with MusicBrainz Picard, using this release.

This partially covers issue #418

@ghlupe2
Copy link
Contributor Author

ghlupe2 commented Mar 28, 2020

TMCL (performer), TXXX:WORK, TXXX:WRITER, TPUB (label) and TXXX:MusicBrainz Album Type (release type) is auxiliary data that has been defined in config.xml:

    <library-options>
      <id3>
         <auxdata>
            <add-data tag="TMCL"/>
            <add-data tag="TXXX:WORK"/>
            <add-data tag="TXXX:Writer"/>
            <add-data tag="TPUB"/>
            <add-data tag="TXXX:MusicBrainz Album Type"/>
         </auxdata>
      </id3>
    </library-options>


@KarlStraussberger
Copy link
Member

Added a PR that should fix the issue. It relies on taglib, so if taglib does what it say, you should be fine!

@KarlStraussberger
Copy link
Member

fixed via #941 also

@whyman
Copy link
Member

whyman commented Jul 10, 2020

@KarlStraussberger if you include "Closes: #941" in your commit messages these will get done automagically

@whyman whyman closed this as completed Jul 10, 2020
@KarlStraussberger
Copy link
Member

Well, I added this one with a comma :-(

@whyman
Copy link
Member

whyman commented Jul 10, 2020

Ah, need a separate Closes tag for each one.

@ghlupe2
Copy link
Contributor Author

ghlupe2 commented Jul 14, 2020

I'm afraid that #941 had no effect on this issue, which wasn't a lack of importing all values but presenting them without a separator. ID3v2.4 suggests the null character. Shouldn't they become visible by e.g.
performer=performer.replace(/\0/g, "|"); ?

@KarlStraussberger
Copy link
Member

Well, in that case it is more an issue of TagLib than Gerbera. We take what we get and expect TagLib to properly read the tags. I my tests I've used serveral clients and each one added another separator ";" "/" ",". Anyway, we need to present it in UPnP results and on the UI, so we have to add a separator on our own, which is "," at the moment. The best thing I can offer is, making it configurable.

@ghlupe2
Copy link
Contributor Author

ghlupe2 commented Jul 15, 2020

Thinking of artists like Sammy Davis, Jr. or AC/DC l'd prefer ";" as a default setting.

@whyman
Copy link
Member

whyman commented Jul 15, 2020

Thinking of artists like Sammy Davis, Jr. or AC/DC l'd prefer ";" as a default setting.

Good point, semicolon would be better.

@ghlupe2
Copy link
Contributor Author

ghlupe2 commented Jul 17, 2021

Just wanted to say THANK YOU to @imolb for providing a fix for this issue that was open since ancient mediatomb times. It perfectly deals with any multi-valued id3 tag by using a custom script and finally I can drop my workaround userscripts in MusicBrainz Picard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants