# Duplicate tag values and insertion of lowercase tag names

**URL:** <https://community.metabrainz.org/t/duplicate-tag-values-and-insertion-of-lowercase-tag-names/618451>\
**Category:** MusicBrainz Picard\
**Tags:** taggerscript, picard\
**Created:** [January 10, 2023, 5:22pm UTC](https://community.metabrainz.org/t/duplicate-tag-values-and-insertion-of-lowercase-tag-names/618451 "2023-01-10T17:22:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![majkinetor](https://community.metabrainz.org/user_avatar/community.metabrainz.org/majkinetor/32/2380_2.png) [@majkinetor](https://community.metabrainz.org/u/majkinetor)\
**Post date:** [January 10, 2023, 5:22pm UTC](https://community.metabrainz.org/t/duplicate-tag-values-and-insertion-of-lowercase-tag-names/618451/1 "2023-01-10T17:22:44Z")

</div>

I have this automatic script:

```auto
$if(%MM_TAGS%,,$set(MM_TAGS,Electronic))
$if(%MM_DATE%,,$set(MM_DATE,$timestamp()))

```

 ![image](https://community.metabrainz.org/uploads/default/original/3X/f/7/f75987aa465b3972eee458a8763a216b7be9782c.png)

When those tags are not present, everything works fine. When they are , i.e. I reopen album in Picard later to fix some tags and I get above tags doubled as lower case along with original case:

![image](https://community.metabrainz.org/uploads/default/original/3X/3/d/3d2686c65227d36ff37bd2d7ee4d3ded1b72320c.png)

Picard alone added the lower case lettered tags which are not present in the metadata. Here is the screenshot of the Foobar2k song properties:

 ![image](https://community.metabrainz.org/uploads/default/original/3X/1/1/11c36108f8b4e5f41c7f7658c6d2feb1847ddf75.png)

If I don’t remove older tags they are merged by Picard:

![image](https://community.metabrainz.org/uploads/default/original/3X/4/d/4dfb238925ff8235bf2f385808878a7d2ad2ca2c.png)

This looks like a Picard bug to me, not sure what else it could be?

---

<div class="post-metadata">

**Author:** ![Sophist](https://community.metabrainz.org/user_avatar/community.metabrainz.org/sophist/32/70055_2.png) [@Sophist](https://community.metabrainz.org/u/Sophist)\
**Post date:** [January 10, 2023, 5:44pm UTC](https://community.metabrainz.org/t/duplicate-tag-values-and-insertion-of-lowercase-tag-names/618451/2 "2023-01-10T17:44:41Z")

</div>

Have you tried using lower case for your script?

(I suspect that Picard is simply defaulting to lower case for the old tags and you then create new upper-case versions.)

---

<div class="post-metadata">

**Author:** ![majkinetor](https://community.metabrainz.org/user_avatar/community.metabrainz.org/majkinetor/32/2380_2.png) [@majkinetor](https://community.metabrainz.org/u/majkinetor)\
**Post date:** [January 10, 2023, 6:01pm UTC](https://community.metabrainz.org/t/duplicate-tag-values-and-insertion-of-lowercase-tag-names/618451/3 "2023-01-10T18:01:47Z")

</div>

Yeah, that fixes it, tags are again in the result uppercase and there are no lowercase variants.

This weird behavior should be fixed anyway, unless I am mistaken about something crucial. I see now that Foobar converts lowercase tag names to uppercase on save, so maybe its that custom tags MUST be uppercase. But even so, behavior is IMO not correct - I shouldn’t get lowercased tags then anyway.

---

<div class="post-metadata">

**Author:** ![yindesu](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/y/b77776/32.png) [@yindesu](https://community.metabrainz.org/u/yindesu)\
**Post date:** [January 10, 2023, 6:21pm UTC](https://community.metabrainz.org/t/duplicate-tag-values-and-insertion-of-lowercase-tag-names/618451/4 "2023-01-10T18:21:43Z")

</div>

Picard scripting is case-sensitive, and in general, you have to handle MP3 differently from M4A differently from FLAC/Vorbis, which requires lots of branches in your tagger scripts.

e.g.,

> [@Taggerscript: Compatible MP3 tags](https://community.metabrainz.org/t/taggerscript-compatible-mp3-tags/556607):
>
> By default, Picard writes MP3 tags that don’t have great compatibility with a mixed format library (e.g., mix of MP3 files and FLAC files), or play nicely with foobar2000. This script moves Picard fields so that they look the same as FLAC files in foobar2000. $if($eq($upper(%\_extension%),MP3), $noop(Move UFID:http://musicbrainz.org to TXXX) $set(MUSICBRAINZ\_TRACKID,%musicbrainz\_recordingid%) $unset(musicbrainz\_recordingid) $noop(foobar2000 can't read INVOLVED PEOPLE / TIPL v2.4 / IPLS v2.3) …

---

<div class="post-metadata">

**Author:** ![majkinetor](https://community.metabrainz.org/user_avatar/community.metabrainz.org/majkinetor/32/2380_2.png) [@majkinetor](https://community.metabrainz.org/u/majkinetor)\
**Post date:** [January 10, 2023, 6:32pm UTC](https://community.metabrainz.org/t/duplicate-tag-values-and-insertion-of-lowercase-tag-names/618451/5 "2023-01-10T18:32:59Z")

</div>

@yindesu So you say its not a bug ? 🙂 If its case sensitve, why is it listing lowercased tags which I didn’t specify anywhere?

BTW, I have only mp3 and flac and behavior is the same on both.

---

<div class="post-metadata">

**Author:** ![yindesu](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/y/b77776/32.png) [@yindesu](https://community.metabrainz.org/u/yindesu)\
**Post date:** [January 10, 2023, 6:35pm UTC](https://community.metabrainz.org/t/duplicate-tag-values-and-insertion-of-lowercase-tag-names/618451/6 "2023-01-10T18:35:54Z")

</div>

> [@majkinetor](#):
>
> BTW, I have only mp3 and flac and behavior is the same on both.

1. For standard Picard fields, you need to use the “Internal Name” defined here: [https://picard-docs.musicbrainz.org/en/appendices/tag\_mapping.html](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html) - remember that Picard is case-sensitive.
2. For proprietary MP3 (TXXX) fields, you need to use ALL CAPS.
3. For proprietary FLAC fields, you need to use all lowercase.
