Set oldest year

Hello,
I was playing around with plugins in Musicbrainz Picard to get the original year from recordings in Albums with various artists.
I got 2 examples (1 dificult album and 1 "commercial album" with hits = easy to find data)
It is rather slow but it works better then i expected.
Even with later live releases it gives sometimes the right data.
At the moment i have an action that cleans the data for the years to 4 diggits.
So far so good.
Now what I want is that the oldest year comes in %year%
I looked around, but i didn't find the whole answer on this forum.
I tried to build further on $if(%origyear%,$left(%origyear%,4),%year%)
but i am not able to put the other variables in this formula :confused:
In excel i can write a formula but i can't figure it out in mp3tag :o
tags:
%year%, %origyear%, %originalyear% and %recordingdate%, %releaseyear%
The Tag ORY is the year that the compilation was released and is a copy of releasedate (%releaseyear%)
Sometimes piccard overwrite this tag, so i moved this to there, depends what plugin i use.

If year is empty it should look further to %origyear%, %originalyear%, %releaseyear% to set lowest year.
If there is no useful data (= year, origyear, originalyear is empty or greater or equal then ORY)
AND if there is data in recordingdate and there is an difference from more then 2 years, i would fall back to recordingdate and set this in year tag.
If there is totally no usefull data, i want to end up with empty year tag.

I hope this is posible to create
thnx


IMHO the $if() is too short as it does not say when the $if() should return true or false.
To get the leading numeroc part of a string, you could use $num().
TBH: I don't understand what the comparison of %origyear% with %origyear% should deliver.
For the general processing:
I would create an action group that has a separate action for each comparison.
A sample action could look like this:
Format value for YEAR
Format string: $if($less($num(%year%,1),$num(%origyear%,1)),$num(%year%,1),$num(%origyear%,1))
Next action:
Format value for YEAR
Format string: $if($less($num(%year%,1),$num(%originalyear%,1)),$num(%year%,1),$num(%originalyear%,1))
and so on for each date tag field.

This is technically possible, yes.
But you have to nest a lot of $if functions for your goal.
image

You would have to compare every year-variant with the next one:


and combine it with your above $if construction.

You could also try

$num($sort([%year%,][%origyear%,][%originalyear%,][%recordingdate%,][%releaseyear%],','),1)

Not sure if it meets all your requirements, but it will return the oldest year.

What a clever way to use the new $sort() function!

Very smart way to solve the YEAR issue. :+1:

thnx
i don't have much time this week, but i going to try experiment with all those tips

i just finished my action to clean tags to 4 diggits year.
the year format goes from:
"empty"
0001-01
0001-01-1963
1963
1964-03
1963-03-19
1941-06
01/01/1993
for now it looks good and is working and returns the year in 4 digits and i have clean data to work with.
When my action is finished, i will let it reviewing.
Maybe it is possible to shorten the action...

Hi,
Sorry for the waiting. Didn't had much time...
I did mess around in Musicbrainz with other Plugins and I use another plugin now.
It took 2-3 days to reload 18000 songs and get data.
So at this time I have clean dates and rewrite my action and is much shorter.
The action contain parts that found on this forum.
Like this: $regexp(%ory%,'^.(\d\d\d\d).$','$1')
This is real chinese for me.

Thank you all for your time and help. I am Dj and the original release dates is something I use to create smart playlist in itunes and sort out my music.

I got 1 question:
If field (%cmpl%) that contains C1 or BstO,
can i trigger another part of an action?

Format $if($geql($num(%year%,1),$num(%ory%,1)),$num(123,1),$num(%year%,1))
Thnx

This regular expression takes the contents of your ORY field and extracts 4 digits from it - wherever those 4 digits are.
Without knowing the contents of ORY, we can only guess whether these are the 4 digits for a year. It seems that you overwrite the content of ORY with these 4 digits.

According your screenshot, you repeat this for your other fields like YEAR, ORIGYEAR, ORIGINALYEAR, RECORDINGDATE and RELEASETIME.

It works, that is for me the main part :slight_smile:
and yes I repeat this for the 5 fields, because the fields contain dates that i convert to 4 diggit year.
Then i sort them with the action part from Florian and end up with the lowest year in Year field

According to your screenshot, you will get the same value in the RELEASETIME and ORY field.
All the "year" fields other than YEAR, ORY and RELEASETIME are deleted.
Is this your intention?

Hi,
ORY is a custom tag and a back-up for RELEASETIME.
I use the value as when the album was released.
Itunes does sometimes delete the releasetime tag.
If I want i can shoot it back from ORY to RELEASETIME or for example to comments if I want.

I got a lot of compilations and my "goal" was to get the original date of release from the track.
when i got the recording date I am pretty close to the release date of a track.

15 years ago it was nearly not possibly to automatic get this info, If you wanted the releasedate of a track you had to look it up and enter this manual.

In all the date can be off 2 years between the release/ recording time and the time it was in the top 30 in Belgium. (In the 70's-80's sometimes it took 1 year for a UK or US track to find it's way to the top 30 in Belgium)

After i extract the lowest year (with the data i got from musicbrainz) I delete the other dates.
The only 2 dates I want is the first date of release of the record and when the album was released.

With this "data" for me as dj this can trigger sometimes what the next record is for playing in a set because i know exactly in what timezone i am in.

For "hits" it is +95% possible to get that date from musicbrainz.
For tracks that are older or unknow music like afro jazz stuff it output max 50% or less.

Gggrrttttzzzz