Uploaded image for project: 'Picard'
  1. Picard
  2. PICARD-1101

Read & write the ID3 tag fields in all caps

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 1.4.2, 2.2
    • Tags & Metadata
    • None

      The issue for me surfaced some time ago when I was trying to tag my mp3 files with the "artists" tag. Picard writes the tag field as "TXXX:Artists", but some other taggers (namely Mp3Tag and Foobar2000) will write it in all caps as "TXXX:ARTISTS" and since ID3 tag names are case sensitive, it shows as another field among the taggers. We talked a little bit about this on irc the other day and I was told by @Sophist that he plans to convert (possibly all) the tags to upper case so "transcoders who don't know the Picard-specific tags can transcode them correctly".

      As of now, there are tickets for TXXX:Work (PICARD-1049) and TXXX:Artists (PICARD-1416).

          [PICARD-1101] Read & write the ID3 tag fields in all caps

          With https://github.com/metabrainz/picard/pull/1263 we will get a mechanism that will read / write certain tags case insensitive (and preserve existing casing). We could a) add explicit mappings for some more tags to be treated case insensitive and b) default to make all unmapped tags also be treated case insensitive.

          I think this would solve this issue, because Picard would be able to read the tags independent of casing and also preserve the casing for compatibility with other tools.

          Philipp Wolfer added a comment - With https://github.com/metabrainz/picard/pull/1263 we will get a mechanism that will read / write certain tags case insensitive (and preserve existing casing). We could a) add explicit mappings for some more tags to be treated case insensitive and b) default to make all unmapped tags also be treated case insensitive. I think this would solve this issue, because Picard would be able to read the tags independent of casing and also preserve the casing for compatibility with other tools.

          Peter Culak added a comment - - edited

          Well, it's weird that the originalyear tag is unmapped because it's getting data from mb and being written into tags (I disabled all of my plugins and scripts to see if it does it by default). See the image below:

          Thanks for the albumartists script, I will be using it for now

          Peter Culak added a comment - - edited Well, it's weird that the originalyear tag is unmapped because it's getting data from mb and being written into tags (I disabled all of my plugins and scripts to see if it does it by default). See the image below: Thanks for the albumartists script, I will be using it for now

          originalyear is unmapped, which means that Picard just does what it does for all unmapped tags and writes it as TXXX:tagname. We probably could map it if other tools make use of this. But the originaldate gets written to TDOR anyway, so not sure whether this is needed.

          ~albumartists is just an internal Picard variable and is not written to tags. You can define any tag using it with something like:

          $setmulti(ALBUMARTISTS,%_albumartists%)

          Philipp Wolfer added a comment - originalyear is unmapped, which means that Picard just does what it does for all unmapped tags and writes it as TXXX:tagname. We probably could map it if other tools make use of this. But the originaldate gets written to TDOR anyway, so not sure whether this is needed. ~albumartists is just an internal Picard variable and is not written to tags. You can define any tag using it with something like: $setmulti(ALBUMARTISTS,%_albumartists%)

          Peter Culak added a comment -

          Re: my previous reply: Support for all MusicBrainz specific tags (including AcoustID tags) have been added into Mp3Tag, so there are no more inconsistencies for these tags between Mp3Tag and Picard.

          As for the remaining TXXX tags which needs to be capitalized, I thought that only TXXX:Writer remains, but today I found out when visiting the following thread on Mp3Tag forums: https://community.mp3tag.de/t/add-field-mapping-for-musicbrainz-picard/44062 that Picard also stores Original Year as TXXX:originalyear , so this one should be changed as well (whether to TXXX:ORIGINALYEAR or TXXX:ORIGINAL_YEAR as was suggested in https://tickets.metabrainz.org/browse/PICARD-700). Interestingly, I haven't found this tag in https://github.com/phw/picard/blob/87a6622db22ba1569c32e4e34e38c5e8a63f14bf/picard/formats/id3.py , so maybe there could be even more tags that should be capitalized?

          Lastly, there's stuff like ~albumartists which is currently an unofficial tag. Is there a list of these tags with their corresponding TXXX tag mappings somewhere? Might as well capitalize all of these too if there aren't too many of them.

          Peter Culak added a comment - Re: my previous reply: Support for all MusicBrainz specific tags (including AcoustID tags) have been added into Mp3Tag, so there are no more inconsistencies for these tags between Mp3Tag and Picard. As for the remaining TXXX tags which needs to be capitalized, I thought that only TXXX:Writer remains, but today I found out when visiting the following thread on Mp3Tag forums: https://community.mp3tag.de/t/add-field-mapping-for-musicbrainz-picard/44062 that Picard also stores Original Year as TXXX:originalyear , so this one should be changed as well (whether to TXXX:ORIGINALYEAR or TXXX:ORIGINAL_YEAR as was suggested in https://tickets.metabrainz.org/browse/PICARD-700 ). Interestingly, I haven't found this tag in https://github.com/phw/picard/blob/87a6622db22ba1569c32e4e34e38c5e8a63f14bf/picard/formats/id3.py , so maybe there could be even more tags that should be capitalized? Lastly, there's stuff like ~albumartists which is currently an unofficial tag. Is there a list of these tags with their corresponding TXXX tag mappings somewhere? Might as well capitalize all of these too if there aren't too many of them.

          Invisible Man added a comment - - edited

           Just three more "sources":

          Quote from Quodlibet

          General Deviations

          Since we translate to and from many formats, sometimes we’re forced to accept the lowest common denominator among tag formats:

          Tag names are always case-insensitive.

           

          Quote from puddletag

          About "Mapping" ("...with mappings you can ‘rename’ puddletag fields...")

          • Tag can be one one of ID3, MP4, APEv2 (for Musepack, WavPack, etc.) or VorbisComment (for FLAC and Ogg Vorbis). Note that these are case-sensitive.
          • You can also set mappings for Tag Sources using the exact Tag Source’s name. eg. MusicBrainz.

           

          Quote from mutagen

          About APEv2

          APEv2 tags, like Vorbis comments, are freeform key=value pairs. [...]Keys are case-sensitive, but readers are recommended to be case insensitive, and it is forbidden to multiple keys which differ only in case. Keys are usually stored title-cased (e.g. ‘Artist’ rather than ‘artist’).

           

          Invisible Man added a comment - - edited  Just three more "sources": Quote from Quodlibet General Deviations Since we translate to and from many formats, sometimes we’re forced to accept the lowest common denominator among tag formats: Tag names are always case-insensitive .   Quote from puddletag About "Mapping" ("...with mappings you can ‘rename’ puddletag fields...") Tag can be one one of ID3, MP4, APEv2 (for Musepack, WavPack, etc.) or VorbisComment (for FLAC and Ogg Vorbis). Note that these are  case-sensitive . You can also set mappings for Tag Sources using the exact Tag Source’s name. eg. MusicBrainz.   Quote from mutagen About APEv2 APEv2 tags, like Vorbis comments, are freeform key=value pairs. [...] Keys are case-sensitive , but readers are recommended to be case insensitive, and it is forbidden to multiple keys which differ only in case. Keys are usually stored title-cased (e.g. ‘Artist’ rather than ‘artist’).  

          Paul Taylor added a comment - - edited

          'I also don't see how uppercasing the tags will automatically solve any transcoder problems. If the transcoders need to understand the tag to write it to a specific tag in another format (e.g. writing TXXX:WORK in ID3 to (c)wrk in MP4) they will need to understand the tag'

          It wont help with that mp4 case, but it will help with ID3 <-> VORBISCOMMENT, i,e any conversion between Mp3/Wav/Aif/Dsf to Flac/Ogg and back again when using TXXX fields, using uppercase for both ID3 TXXX fields and Flac where we can solves the problem

          Paul Taylor added a comment - - edited 'I also don't see how uppercasing the tags will automatically solve any transcoder problems. If the transcoders need to understand the tag to write it to a specific tag in another format (e.g. writing TXXX:WORK in ID3 to (c)wrk in MP4) they will need to understand the tag' It wont help with that mp4 case, but it will help with ID3 <-> VORBISCOMMENT, i,e any conversion between Mp3/Wav/Aif/Dsf to Flac/Ogg and back again when using TXXX fields, using uppercase for both ID3 TXXX fields and Flac where we can solves the problem

          Peter Culak added a comment -

          I don't have any issues with closing this ticket if you don't ever plan to capitalize all tags (including stuff like TXXX:Acoustid Id or mb tags like TXXX:MusicBrainz Artist Id). I am not sure about the transcoder problems (that message was what I have been told at the time), but I basically just wanted to have the possibility to freely edit some of the tags outside of Picard without having to deal with duplicate fields.

          Even though I won't ever touch AcoustID or MB specific tags outside of Picard for tagging purposes, when I was testing stuff related to PICARD-949 and was manually editing the AcoustID field in Mp3Tag, upon loading the file into Picard it seems like a slightly different tag was listing the AcoustID so pressing scan in Picard created the original field once again, so there were 2 tags now: https://i.imgur.com/s5KHMfw.png (I just tested this in 2.04). I thought the MB specific fields would behave the same way but I just tested the MusicBrainz Artist Id and similar issue did not occur so the issue only happens with the AcoustID field. Do you know if this is an issue with Mp3Tag or with Picard?

          Peter Culak added a comment - I don't have any issues with closing this ticket if you don't ever plan to capitalize all tags (including stuff like TXXX:Acoustid Id or mb tags like TXXX:MusicBrainz Artist Id). I am not sure about the transcoder problems (that message was what I have been told at the time), but I basically just wanted to have the possibility to freely edit some of the tags outside of Picard without having to deal with duplicate fields. Even though I won't ever touch AcoustID or MB specific tags outside of Picard for tagging purposes, when I was testing stuff related to PICARD-949 and was manually editing the AcoustID field in Mp3Tag, upon loading the file into Picard it seems like a slightly different tag was listing the AcoustID so pressing scan in Picard created the original field once again, so there were 2 tags now: https://i.imgur.com/s5KHMfw.png (I just tested this in 2.04). I thought the MB specific fields would behave the same way but I just tested the MusicBrainz Artist Id and similar issue did not occur so the issue only happens with the AcoustID field. Do you know if this is an issue with Mp3Tag or with Picard?

          Not sure about this ticket. We have to deal with changes to tags on a case by case basis anyway. And there are a couple of TXXX tags we definitely will not and cannot uppercase, most importantly the various MusicBrainz ID and AcoustId fields.

          Affected tags can be seen in https://tickets.metabrainz.org/browse/PICARD-1416 by looking at the TXXX: fields. Ignoring TXXX:MusicBrainz... and TXXX:AcoustId... this leaves us with:

          • TXXX:Work
          • TXXX:Artists
          • TXXX:Writer

          The first two we will deal with in PICARD-1049 and PICARD-1416. For TXXX:Writer I am not sure, but it does not seem to get used a lot outside of Picard, I found it in no other software's tag mapping. So probably save to change as well.

          I also don't see how uppercasing the tags will automatically solve any transcoder problems. If the transcoders need to understand the tag to write it to a specific tag in another format (e.g. writing TXXX:WORK in ID3 to (c)wrk in MP4) they will need to understand the tag. And either they read it case sensitive from ID3, in which case we need to match the transcoders casing, or the don't, in which case it doesn't matter.

          The other case is they just write one freeform tag to another format without understanding it. But in that case the issue is that other some formats are also case sensitive, and might use/require a different casing.

          In either case we always have to choose the casing with the best compatibility.

          Philipp Wolfer added a comment - Not sure about this ticket. We have to deal with changes to tags on a case by case basis anyway. And there are a couple of TXXX tags we definitely will not and cannot uppercase, most importantly the various MusicBrainz ID and AcoustId fields. Affected tags can be seen in https://tickets.metabrainz.org/browse/PICARD-1416 by looking at the TXXX: fields. Ignoring TXXX:MusicBrainz... and TXXX:AcoustId... this leaves us with: TXXX:Work TXXX:Artists TXXX:Writer The first two we will deal with in PICARD-1049 and PICARD-1416 . For TXXX:Writer I am not sure, but it does not seem to get used a lot outside of Picard, I found it in no other software's tag mapping. So probably save to change as well. I also don't see how uppercasing the tags will automatically solve any transcoder problems. If the transcoders need to understand the tag to write it to a specific tag in another format (e.g. writing TXXX:WORK in ID3 to (c)wrk in MP4) they will need to understand the tag. And either they read it case sensitive from ID3, in which case we need to match the transcoders casing, or the don't, in which case it doesn't matter. The other case is they just write one freeform tag to another format without understanding it. But in that case the issue is that other some formats are also case sensitive, and might use/require a different casing. In either case we always have to choose the casing with the best compatibility.

          Paul Taylor added a comment -

          Paul Taylor added a comment - Artists is a TXXX tag, IMO the best taggingmapping doc is https://docs.google.com/spreadsheets/d/1afugW3R1FRDN-mwt5SQLY4R7aLAu3RqzjN3pR1497Ok/edit?usp=sharing

            Unassigned Unassigned
            culinko Peter Culak
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

                Version Package