Help converting YEAR field YYYY-MM-DD to multiple fields in Mp3tag for FLAC files

Hi everyone,

I’m having trouble with Mp3tag and need some guidance. Here’s my situation:

  • My audio files are in FLAC format.

  • The YEAR field in my files is in the format YYYY-MM-DD, for example 2021-05-15.

  • I want to transform and distribute this information across several fields so that Djay Pro 5.5 can properly recognize them:

    1. RELEASEDATE → should contain the full date in DD/MM/YYYY format (for example 15/05/2021).

    2. TRACK → should contain the month as a number (for example 5), because I use the Track Number field in Mp3tag as the Djay “Track Number of Album” field for smart playlists.

    3. YEAR → should be reduced to just the year (for example 2021).

  • Some of my tracks may have already used the suggestion from this post: Script/format to extract month from YEAR for Track number

I have tried using Actions / Format value with $regexp and $mid, and the logic works if the YEAR field is in YYYY/MM/DD. But now that my files have YYYY-MM-DD, nothing seems to copy correctly to RELEASEDATE. I’ve also tried executing actions in order (RELEASEDATE first, then TRACK, then YEAR), but RELEASEDATE remains empty.

I would like guidance on:

  • The correct regexp or Mp3tag action to convert YYYY-MM-DD to DD/MM/YYYY in RELEASEDATE.

  • How to safely extract the month to TRACK.

  • How to reduce YEAR to only the year.

  • Any tips to ensure the actions run without losing data, so that Djay Pro can correctly use the smart playlists based on the Track Number and Year fields.

Thank you very much for your help!

PD: I’ve searched the forum but haven’t found my specific case discussed — I’ve seen some similar support topics, but they don’t seem to match exactly what I’m trying to do.

You can throw all this into the same Action:

  • Try this: $regexp(%year%,(\d{4})(?:-|/)(\d{1,2})(?:-|/)(\d{1,2}),$3/$2/$1), it’ll capture 3 groups of numbers, separated by non-captured groups of - or /, then place them in a new order.

  • To get the month value transferred over to TRACK, use an Action to find it with regex similar to above, format to a temporary made-up tag like MONTH or TEMP, use that in your TRACK formatting then remove the temporary tag as the last step. Use $num(%temp%,2) to add leading zeros, if needed.

  • Try this: $regexp(%year%,.*(\d{4}).*,$1), just grabs the first 4-digit number.

  • Use Columns to test functions in the Value input (nothing in Field!!) to see the results without actually changing it then when you’re happy it’ll work long-term, stick it in your Action and test again on copies of multiple files with different values. And if all else fails, keep backups. :grimacing:

Wasn't that already solved in this thread:

Yes — in that post they solved extracting the month (MM) from the YEAR column (DD-MM-YYYY) and putting it into the Track field so metadata would be read correctly by Rekordbox. However, I have migrated to DJAY PRO and it appears to read metadata differently. The actions I used work perfectly when YEAR is in YYYY/MM/DD format, but my files use - instead of /, so the original actions from my first post fail because I can’t reliably replace - with /, which I believe breaks the whole action chain.

At least the $mid() function for TRACK should work as before as it simply looks at position no. 6 in the date string and takes the character and the next one. That would be the month, I think.

It didn’t work for me — I’m sharing the configuration of my tracks below.

If I run this action group, it leaves everything exactly as I want it (except that it doesn’t convert the “-” into “/”).

And this is the action group you suggested, which doesn’t work.

The key is being able to replace the “-” symbol with “/” in the YEAR and RELEASEDATE fields, and then have the TRACK field copy the MM value from YEAR.

All this confusion is because in DJAY PRO I can create smart playlists using filters, and I want to use the Track Numberfield (TRACK in Mp3tag and DJAY), Year (YEAR in Mp3tag and DJAY PRO), or Release Date (RELEASEDATE in Mp3tag and DJAY PRO) for that purpose. However, in the FLAC files I have, the Year format is DD-MM-YYYY, and there is no evidence that DJAY PRO expects or interprets the Year field as a simple YYYY number or as a full date. That’s why I thought about using Mp3tag to extract those values into other fields to…

I think the field is called RELEASETIME

To get the various parts from

YEAR only = $regexp(%year%,(\d\d\d\d)-(\d\d)-(\d\d),$1)
Month only = $regexp(%year%,(\d\d\d\d)-(\d\d)-(\d\d),$2)
Day only = $regexp(%year%,(\d\d\d\d)-(\d\d)-(\d\d),$3)
Shuffle the parts around: $regexp(%year%,(\d\d\d\d)-(\d\d)-(\d\d),$3/$2/$1)

I’m confused by your images as there’s different tracks with different years etc. between them, so I can’t see exactly what’s supposed to be correct :sweat_smile: Is the 4th image how you want it to end up or a result of your configuration?

If all you need to do is change - to /, just stick a Replace action at the bottom of your set for each tag you need changed.

Also apologies, you don’t really need a TEMP tag, I had assumed you wanted the the month value added in front of an existing TRACK so it can go straight onto that.

@arb sorry, it’s not your fault — my native language is Spanish and my English is basically zero. I communicate with you through translators, and of course the image gets translated too, so I can’t tell what is correctly or incorrectly written. I’m going to edit the post so it’s easier to understand.

My track info Flac

My mp3tag configuration:

And that’s how I want it to look.

The track is different, but the result is the same.

I’ve tested and made an Action that should do it.

djay Pro.mta (354 Bytes)

Before:

After:

It works with tags formatted as either YYYY-MM-DD or DD-MM-YYYY and replaces any separator to /. It uses RELEASETIME if already there, otherwise uses YEAR.

As @ohrenkino points out, RELEASETIME is an official tag similar to YEAR or DATE, as opposed to RELEASEDATE. You can open the Action and replace any mentions of it to whatever is needed as I couldn’t find a list of Djay Pro’s supported tags. .FLAC and VorbisComment’s supported tags could also have an effect.

Refer to this to add the Action:

Merge it add actions from another database - Support - Mp3tag Community

Thanks @arb, it seems to work but actually doesn’t — or maybe it’s a bug in Mp3tag, because I imported the action file and it looks like it runs, but I can only see the RELEASEDATE in the extended tags, not in the columns.

I’ve checked the Mp3tag configuration and the tags, and they’re exactly the same as in the screenshots I posted earlier — nothing has changed.
The file has permissions.

Good to hear it almost works! This might be a translation thing, I’m seeing PUBLICADO which looks like the date format you’re looking for but isn’t an official tag, neither is RELEASEDATE however RELEASETIME is an official tag along with DATE and YEAR. I can’t see any tags changing name when I change my language to Spanish.

Check your RELEASEDATE column to make sure the tags are the same in Value/Valor.

You’ll also want to see if it shows up in djay Pro then possibly change the tag’s name until it does show up.

Confirmed, the field that DJAY PRO reads is RELEASEDATE — but it only does it when it feels like it.

That’s how I see it in Mp3tag… I don’t understand — the RELEASEDATE column is correctly configured with the metadata, so why doesn’t it show up?

However, I can say with almost complete certainty that this is a DJAY Pro bug. There are several complaints about how DJAY Pro handles metadata — it “seems” to go through Apple Music, which I don’t use for my library. Rekordbox, another DJ program, fully utilizes the file tags.

I’m going to open a thread in the Algoriddim forum, and if I get any new information, I’ll come back here, as it might be of interest to someone else.

Take a file that shows the releasedate correctly in the dj program and the inspect it in MP3tag and the extended tags dialogue to see the fieldname. The element label could be anything, the import thing is to which tag field variable the contents is mapped

Yes, that’s what I did — I created a new file, edited it “to my liking” in DJAY PRO, and then opened it in Mp3tag. That’s how I confirmed that the Publicado field corresponds to RELEASEDATE in Mp3tag.

However, it seems that DJAY PRO does not always read the tag. Even if you analyze or re-add the track to the collection, it behaves inconsistently — sometimes it shows up, sometimes it doesn’t.

Mp3tag also behaves strangely: the RELEASEDATE field appears in the extended tags, but it doesn’t show in the columns, even though the field is correctly configured.

Please show us a screenshot of the extended tags dialogue for the file and a screenshot of the column definition

In general: RELEASEDATE is a user-defined field, no standard field.

Yes, I know, but DJAY PRO uses RELEASEDATE as the field, which is why I created RELEASEDATE. I don’t mind using RELEASETIME or YEAR… as long as I can edit the metadata in Mp3tag and DJAY PRO reads it. :slight_smile: