# Help dealing with albumartistsort

**URL:** https://community.mp3tag.de/t/help-dealing-with-albumartistsort/66401
**Category:** Support
**Created:** [November 2, 2024, 2:43pm UTC](https://community.mp3tag.de/t/help-dealing-with-albumartistsort/66401 "2024-11-02T14:43:15Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![sjkiss](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sjkiss/32/15612_2.png) [@sjkiss](https://community.mp3tag.de/u/sjkiss)
#### Post date: [November 2, 2024, 2:43pm UTC](https://community.mp3tag.de/t/help-dealing-with-albumartistsort/66401/1 "2024-11-02T14:43:15Z")

</div>

I basically need one script that does the following:

1. Sets the albumartistsort extended tag field to be equivalent to the "Album Artist" field unless
2. there is a "The" in which case, I would like the albumartistsort field to read "Album Artist, The".

Is this possible?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [November 2, 2024, 2:50pm UTC](https://community.mp3tag.de/t/help-dealing-with-albumartistsort/66401/2 "2024-11-02T14:50:06Z")

</div>

To make it easier: I am pretty sure that the "The" is not necessary any more to sort better.

So I would suggest that you use an action of the type "Format value" or Convert\>Tag-Tag for ALBUMARTISTSORT  
Format string: `$regexp(%albumartist%,^The ,)`  
This simply  
Please watch out for artists that seem to need the "The" like "The The" or "The Band", "The XX".

---

<div class="post-metadata">

### Author: ![sjkiss](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sjkiss/32/15612_2.png) [@sjkiss](https://community.mp3tag.de/u/sjkiss)
#### Post date: [November 2, 2024, 2:55pm UTC](https://community.mp3tag.de/t/help-dealing-with-albumartistsort/66401/3 "2024-11-02T14:55:33Z")

</div>

I don't understand what this does:  
`$regexp(%albumartist%,^The ,)`

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [November 2, 2024, 2:58pm UTC](https://community.mp3tag.de/t/help-dealing-with-albumartistsort/66401/4 "2024-11-02T14:58:37Z")

</div>

Have you tried it?  
It removes any leading "The " and leaves the rest.  
And as I said: if you add the trailing "The" will not make any difference for sorting.

See also here:

> [@Create A New Action to swap first name last name to last name, first name](https://community.mp3tag.de/t/create-a-new-action-to-swap-first-name-last-name-to-last-name-first-name/66006):
>
> I have downloaded MP3TAG to a new computer and require some assistance. Stupidly I did not take a backup of my original which had purpose made 'ACTIONS' I have lost my copy of the syntax code to create 2 separate 'Actions' To enable ARTISTSORT to convert for example, (Artist) Elvis Presley to Artistsort) Presley, Elvis. To enable ARTISTSORT to convert for example (Artist) The Beatles to (Artistsort) Beatles, removing the 'The' from group names. I would appreciate some help. A Basic …

---

<div class="post-metadata">

### Author: ![sjkiss](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sjkiss/32/15612_2.png) [@sjkiss](https://community.mp3tag.de/u/sjkiss)
#### Post date: [November 2, 2024, 10:59pm UTC](https://community.mp3tag.de/t/help-dealing-with-albumartistsort/66401/5 "2024-11-02T22:59:46Z")

</div>

The other problem that I have is a lot of albumartistsort fields are something like "Drake, Nick" and I would like it to be "Nick Drake.  
I can see how your script would solve my problem for the "The" though. But how do I solve the first problem? All my Album Artist fields are the way I want them, I just wanted to port over what is in Album Artist to albumartistsort.

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [November 3, 2024, 12:08am UTC](https://community.mp3tag.de/t/help-dealing-with-albumartistsort/66401/6 "2024-11-03T00:08:08Z")

</div>

> [@sjkiss](#):
>
> All my Album Artist fields are the way I want them, I just wanted to port over what is in Album Artist to albumartistsort.

This is a simple Convert Tag-Tag and set Albumartistsort to be Albumartist.

But why would you want these to be identical? It defeats the purpose of having the sort field. It is intended to allow you to have the Albumartist displayed as expected but sorted under a different way. Removing articles like A, An, and The are the most obvious ones in English. Your other example of Drake, Nick is to have that artist sorted under the D's as you would find them in store.

Otherwise you can leave this field u filled and most players and media managers will default back to the standard field.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [November 3, 2024, 6:41am UTC](https://community.mp3tag.de/t/help-dealing-with-albumartistsort/66401/7 "2024-11-03T06:41:15Z")

</div>

> [@sjkiss](#):
>
> I can see how your script would solve my problem for the "The" though. But how do I solve the first problem?

My suggestion would copy ALBUMARTIST to ALBUMARTISTSORT in all cases and only for those with a leading "The" it would leave out that article.

And in general for the problem of copying fields, there is a post in the FAQs:

> [@Actions and batch-operations](https://community.mp3tag.de/t/actions-and-batch-operations/967/15):
>
> How to copy one field value to another field? Example how to copy the content of the ARTIST field to the ALBUMARTIST field: Create a [new action](https://community.mp3tag.de/t/actions/967/2) in an existing action group or make a new action group. Action type: Format value Field: ALBUMARTIST Format string: %artist% Note: If you want to copy all possible values of a field (in case you have multiple artist fields), the internal scripting function [$meta\_sep](https://docs.mp3tag.de/scripting) can be used in the format string, e.g., $meta\_sep(artist,\\\\)

---

<div class="post-metadata">

### Author: ![sjkiss](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sjkiss/32/15612_2.png) [@sjkiss](https://community.mp3tag.de/u/sjkiss)
#### Post date: [November 4, 2024, 2:04pm UTC](https://community.mp3tag.de/t/help-dealing-with-albumartistsort/66401/8 "2024-11-04T14:04:54Z")

</div>

> My suggestion would copy ALBUMARTIST to ALBUMARTISTSORT in all cases and only for those with a leading "The" it would leave out that article

How do I do that if-then construction?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [November 4, 2024, 2:08pm UTC](https://community.mp3tag.de/t/help-dealing-with-albumartistsort/66401/9 "2024-11-04T14:08:49Z")

</div>

> [@sjkiss](#):
>
> that if-then construction

For what would you need such an if-then construction?  
The regular expression works without that.  
The condition is "built-in", so to say, as the regular expression returns the original string if the pattern has not been found.

See the documentation on regular expressions:

> **[Regular Expressions – Mp3tag Documentation](https://docs.mp3tag.de/regex/)**
>
> Documentation on support for regular expressions in Mp3tag. Mp3tag is the universal Tag Editor.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [November 5, 2024, 7:56am UTC](https://community.mp3tag.de/t/help-dealing-with-albumartistsort/66401/10 "2024-11-05T07:56:14Z")

</div>

> [@sjkiss](#):
>
> fields are something like "Drake, Nick" and I would like it to be "Nick Drake.

It would be extremely tricky to separate the artists that have swapped names from those that actually have a comma as they consist of a list.  
E.g.  
Bell, Book and Candle,  
Earth, Wind and Fire  
Dave Dee, Dozy, Beaky, Mick & Tich

Would turn into something like "Book Bell and Candle" or "Bell and Candle Book", "Earth, Wind and Fire" into "Wind Earth and Fire" or "Wind and Fire Earth" ...

The easiest way would be to delete all ALBUMARTISTSORT fields and start from scratch. And "scratch" would mean: fill only those ALBUMARTISTSORT fields that really have to be different from the ALBUMARTIST field.

You could filter for files with a starting "The " with  
`%albumartist% MATCHES "^The "`

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [December 5, 2024, 7:56am UTC](https://community.mp3tag.de/t/help-dealing-with-albumartistsort/66401/11 "2024-12-05T07:56:26Z")

</div>

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