Problem with artists starting by "The..." in "Album Artist Sort Order" and "Artist Sort Order"

artist
name
artistsortname
Tags: #<Tag:0x00007f23c27a9d50> #<Tag:0x00007f23c27a9c10> #<Tag:0x00007f23c27a9ad0>

#1

Hello, :slight_smile:

(I’m french so i will do my best to speak well english :wink:)

Some time ago, I used this topic to solve a problem: I had managed thanks to this topic to classify my artists by First name + Name rather than Name + First name. Everything worked, except that I noticed that for the artists beginning with “The” the artists were in the letter T while I would like that they are, for example for “The Beatles” in B.

Would there be a way so that the Artist Sort Order (and the Album Artist) is the same that the name of the artist excepted for artist beginning with “The” where the order of the artist would be then for example “Beatles, The”?

If anybody had the solution, it would be great! :slight_smile:

Thank you :stuck_out_tongue:


#2

Just to clarify for others reading this: Having “Beatles, The” is the default for the sort name. The issue here is that the default sort name is not being used as in this case tdurivault wants to sort persons by first name, last name. So a script like the following is used:

$set(artistsort,%artist%)

To also fix the sorting for bands starting with The you can use the swapprefix function:

$set(artistsort,$swapprefix(%artist%))

By default $swapprefix will move “The” and “A” at the beginning to the end, so “The Beatles” becomes “Beatles, The”. If you also want other prefixes moved, e.g. for other languages, you can set the prefixes as additional parameters. E.g. to also swap “Die”, the German equivalent of “The” in e.g. " Die Toten Hosen", you can do that:

$swapprefix(%artist%,The,A,Die)


#3

Thank you very much ! :slight_smile:
Everything’s working like i wished.
I added “Les” french equivalent of “The”.
And sorry if my message wasn’t clear for my bad english. :wink:

(And i did the same for album artist)
Here’s what i wrote (if somebody’s interrested)

$set(artistsort,$swapprefix(%artist%))
$swapprefix(%artist%,The,A,Les)
$set(albumartistsort,$swapprefix(%albumartist%))
$swapprefix(%albumartist%,The,A,Les)

Thank you again :blush: