Help - Search - Members - Calendar
Full Version: If %directory% < 4 letters use %parent_directory%+%directory% ?
Mp3tag Forums > Mp3tag - International > Support
Da_maniaC
Hi all,

I was wondering if it would be possible to create an action to automatically fill all my "ArtistAlbum" fields with the Album name (which is always located in the directory name)?

Unless: the directory name is 4 letters long or less, the parent directory should be used.
(4 letters or less, means: CD2, CD01, etc).

Any ideas? smile.gif
JJ Johnson
This can be done, but....

Don't you have (or want) the album name to be in the ALBUM field? Or do you use ARTISTALBUM instead of ALBUM?

You say the album name is "in" the directory name. All by itself, or does it need to be pulled out of the directory name?

It would be better to identify those disc subdirectories by a naming pattern and use a regular expression instead of just using the name length. You probably have many album names with fewer than five characters, so you could create an action that would be more thorough by using a regex.
Da_maniaC
Hey there,

Thanks for your swift reply!

1.) I do indeed think RegEx probably has the right solution...the thing is that i am not very familiar with it (i only know very basic expressions).

2.) I am using a piece of software (Zune) that needs the "AlbumArtist" field to be filled with information too.
All of my other tag fields are nicely organised, but the "album" field only rarely contains the artist name as well. smile.gif

3.) If it would be possible to extract the Artist name from the directory name (for ex.: the words before the "-" (dash) in the directory name) that would be a fairly good solution. But; this would mean that all albums containing "Various Artists" get consolidated into one view with the software i am using (Zune).
JJ Johnson
Ok... ALBUMARTIST, not ARTISTALBUM. For simplicity, I'd do this with a small action group containing three actions:

1.
Action type: Format value
Field: ALBUMARTIST
Format string: %_directory%

2.
Action type: Format value
Field: ALBUMARTIST
Format string: $regexp(%albumartist%,'^cd\s*\d{1,2}$',%_parent_directory%,1)

3.
Action type: Format value
Field: ALBUMARTIST
Format string: $regexp(%albumartist%,'^(.*)-.*$',$trim($1),1)

The first action copies the directory name into ALBUMARTIST. The second will replace that with the parent directory only if the name matches the subdirectory naming pattern ('cd1', 'CD 2', 'cD03', etc.) The third action removes anything after the first dash, leaving only the artist name.

Watch out for any artist names containing dashes. What will happen is that only the first part of the name will end up in the ALBUMARTIST field. You probably don't have very many of these, so you go back and do them manually.

For the 'Various Artists - Album Name' albums I would think you *do* wan't 'Various Artists' for the albumartist name. This puts all of your compilation albums in one place, otherwise you'll end up with album names in your albumartist list instead of only artist names. One thing I like to do with 'Various Artists' albums to use an ALBUMARTIST name of '! Various Artists', which forces this artist name to the beginning of the list when sorted alphabetically.
Da_maniaC
This did the trick perfectly! Thanks a million! smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.