Create action field based on length and files

Is it possible to create an action that creates a RELEASETYPE field based on the amount of files and total duration?

Singles are less than 30 minutes with 3 or fewer tracks. EPs are up to 30 minutes in length with no more than 6 songs. And albums contain 6 or more songs with a total length of over 30 minutes.

RELEASETYPE value:

  • single
  • ep
  • album

Thanks in advance

I doubt that.
As MP3tag does not compare the data between two or more files I do not think that an album can be detected and the length will also not be added.

If you want to get such data, you would have to create an export script, prepare the output in a way that the files belonging to an album can be grouped together and the data be written back to the files.

1 Like

Ok, I hoped Mp3Tag had a function to get the album length and total tracks and write it to add tag and use this in a Action.

I will do some research if I can write a Python script for Beets which can do this.

Something very similar has been discussed in this thread:

including some pieces that would create strange results when treated automatically.

As a first approach: if you have the files in separate folders, then you could run the track numbering wizard to include the totals and then check the total number of files as stored in the field TRACK.
You could filter or check these numbers and then apply the action to fill the relieasetype (which is a user-defined field anyway and will not be picked up by most players - MEDIATYPE would come closest, I think)
The length, though, will not be included

1 Like

Thanks for the update.

My files are in separate folders per album.
I just read the other topic, this is exactly why I was thinking to have 2 conditions total tracks and album duration.
Plex is using RELEASETYPE field to separate singles from albums.

Wouldn't the track length be also an indicator for album sized tracks?
You would not have to calculate the whole album but check that the file is no longer than x minutes - this would all in all indicate an EP or so.

I am not sure, what I wrote in my initial message was a quick Google :smiley:

Here I read:

A Single is a release containing one to three songs that are under 10 minutes each.

An EP contains four to six songs with a total running time of 30 minutes or less.

An Album is a release that contains over 30 minutes of music, a continuous DJ mix, or six different tracks from the same artist.

And here even a more comprehensive guide.

It could work for Singles but wil be difficult for an EP or Album.

And what does list mean in respect to your initial idea?

I would think that you could evaluate the condition as follows:
Is %_length_seconds% greater than 30? ->Album
Is the number of total track greater than 6 ->Album
Is the number of total tracks greater than 3 -> EP
Is the number of total tracks less than 4 -> single.

If you then include a check whether something is already stored in RELEASETYPE then this will not be the case if you run these action from top to bottom.
This should cover most cases.

Only those where are 2 very short tracks and one over 30 minutes you get not the right declaration.
(BTW: 3 single songs with 9:59 would also amount to 30 Minutes or less (29:57) and therefore qualify for an EP. So I think you will not get around a manual check in the end. In my collection real EPs have "EP" in ALBUM. So perhaps that could also help.)

1 Like

That looks great thanks!

Only those where are 2 very short tracks and one over 30 minutes you get not the right declaration.
(BTW: 3 single songs with 9:59 would also amount to 30 Minutes or less (29:57) and therefore qualify for an EP. So I think you will not get around a manual check in the end.

It's OK for me I don't mind to manually edit those occasionally.

I used Beets to tag everything using Musicbrainz and Discogs. I am not sure about Musicbrainz but for discogs it is a hit or a miss. I have seen a vinyl release containing EP in the title where the digital version did not. :frowning:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.