INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: how to list and display artists in a "natural" order (like cds on a shelf)  (Read 5391 times)

Simon C

  • Recent member
  • *
  • Posts: 7

JRiver, everyone,

In the media Centre I list albums by genre, and within genre by the name of the artist. The tags are *not* "last name first", so that for example the three artists "Toshiko Akiyoshi", "Cannonball Adderley", and "Atilla Zoller" are listed in the order:

"Atilla Zoller"
"Cannonball Adderley"
"Toshiko Akiyoshi"

i.e., in alphabetical order starting from the first letter of the first name. What I would like is for the list in Media Centre to *display* the names as first-followed-by-last, but *list* the artists by last name so that on the Media Centre display I would see the artists as this:

"Cannonball Adderley"
"Toshiko Akiyoshi"
"Atilla Zoller"

This corresponds to what one would do with physical media on a shelf (yes, I still have all my cds). The question is: how can I do this in Media Centre? I imagine it might mean creating another tag to index by (e.g., "Zoller, Atilla"), but beyond that I have no idea.

If you know how, please let me know, but please also keep your instructions simple. I would think this facility would be useful to many people.

Thanks!
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353

I don't believe that there is a way to automatically sort by last name, as it's very difficult to determine what is a person's name and what is a band name that shouldn't be swapped around.
It's a bit complex to set up initially, but once it's done, should work as you expect.
 
This post by glynor includes a nice suggestion which should help make things a lot easier.
I have included it in this guide and modified the expression slightly, so that it applies to [Album Artist (auto)] rather than [Artist]
 
1.  Go to: Tools → Options → Library & Folders → Manage Library Fields…
2.  Add a new field called AA Name Swap
3.  Set the field type to "Calculated Data"
4.  Right-click the "Expression" box and open the Expression Editor.
5.  Paste the following code:
 
Code: (AA Name Swap) [Select]
if(!regex([Album Artist (auto)], /#^([^,]+)\s+([^,]*?)$#/),
   [Album Artist (auto)],
   regex(listclean([Album Artist (auto)], 2, / ),
         /#^(?:(I+|[JS]r\.?)\s+)?(\S+)(.*)$#/, -1)[R2]/,/ listclean([R3], 2, / )[R1]
)

6.  Now add another field, which I called Artist Sort. You don't need to change any of the options for this field.
7.  And now we have to add a third and final field, the one which is used to group and sort your albums. In my example I call it _Artist Sort Header
8.  This is another expression field, using this code:
 
Code: (_Artist Sort Header) [Select]
<font size="10" alpha="0" color="ffffff">FirstNotEmpty([Artist Sort], [Album Artist (auto)])<//font>Delimit([Year], /]/ , /[)[Album]Delimit([Album Artist (auto)],,/ by/ )
9.  Now that all our fields have been created, you can return to viewing your library. In your views, you will have to click the downward pointing arrow and select: Group By → More (sort groups a-z) → _Artist Sort Header
10. For any album that you wish to have sorted by last name, select it and open the tagging pane. (right-click and select "tag" or hit ALT+ENTER on the keyboard)
11. In the tagging pane, select the "Artist Sort" field and enter: =[AA Name Swap]
 
 
And that should be it. I know that it's a bit complex, but after that initial setup, it should be easy to use.
The "Artist Sort" field can also be manually edited if =[AA Name Swap] doesn't give you the correct results, but it should most of the time.
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353

You will probably want to customize your Genre library view as well.
I believe the default view lists: Genre → Album Artist (auto) → Album
To use the new Album Sort values, the Album Artist (auto) category has to be replaced.
 
1.  Right-click your Genre view and select "Customize View…"
2.  Select the "Album Artist (auto)" category in the pane on the left, and click the edit button.
3.  Change this from a "Library Field" type to an "Expression" type, and enter:

Code: (Expression to Group By) [Select]
FirstNotEmpty([Artist Sort], [Album Artist (auto)])
If you want items to be sorted by last name, but displayed normally, also enter:
Code: (Expression to Display) [Select]
[Album Artist (auto)]
Logged

Simon C

  • Recent member
  • *
  • Posts: 7

Thank you both for your replies. I have thought about the suggestions, and wonder how to exclude the cases (band names, e.g., "Little Feat") where the ordering *should* be based on the first word. If there is any good documentation on customising the ordering and search - in the ways you suggest - I'd like to see it.

Simon C.
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353

[Album Artist (auto)] is used for sorting if [Artist Sort] is empty.
That's why the FirstNotEmpty() expression is used.
 
So leave [Artist Sort] blank unless you want to change the sort order.
And if you do want to change it, you can either manually enter a value, or use =[AA Name Swap] to automatically fill it out as "last name, first name".
 
The [AA Name Swap] field is only there to save time when filling out [Artist Sort], it is not used for sorting itself.
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353

I see that you prefer albums to be listed alphabetically rather than chronologically.
For that, change the _Artist Sort Header expression in step 8 to:
 
Code: (_Artist Sort Header) [Select]
<font size="10" alpha="0" color="ffffff">FirstNotEmpty([Artist Sort], [Album Artist (auto)])<//font>[Album]Delimit([Album Artist (auto)],,/ by/ )
Logged

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3119

I found that the name swap logic worked for most of my albums because most of my artists are people, not groups.  Therefore, I wanted to use it as the default and only change anything when the automatic method did not work. I modified the process slightly so that [Artist Sort] always has the sort value. The ideas was to have something obvious when I wanted to override the automatic calculation.

1) Calculate [AA Name Swap] as above.

2) Created a field named [Artist Sort Manual]

3) For any album I want to manually edit the artist to sort by, I simply enter that into the [Artist Sort Manual] field, otherwise I leave it blank.

4)[Artist Sort] then becomes if(isempty([Artist Sort Manual],0),[AA Name Swap],[Artist Sort Manual]) or
                                  FirstNotEmpty([Artist Sort Manual],[AA Name Swap])

With that I can always see what [Artist Sort] is and can just use it as my sort field. The few times  I get a bad sort value, I just change the [Artist Sort Manual] field.

Same result, just that the manual field seems like it will be a little more obvious, since I probably will not have to use it often. And the default becomes the [AA Name Swap] calculation.

Note that I sort classical by Composer and Album title, rather than artist, so I do not have to deal with Artist for sorting my classical.
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353

The [Artist Sort Manual] field seems unnecessary if you substitute [Album Artist (auto)] with [AA Name Swap] so that the expression now reads:
 
Code: [Select]
FirstNotEmpty([Artist Sort], [AA Name Swap])
That way it will use [AA Name Swap]—which is automatically calculated—unless [Artist Sort] has a value.
 
Not that there is anything wrong with your solution, but I believe there is a redundant field the way you've done it, since [AA Name Swap] already has the "last name, first name" order.
Logged

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3119

 I would prefer not to type directly into an expression field. The Manual field just makes the process more obvious, at least to me.  Note it is for the exception, which in my case is First Name Last Name or, sometimes,  Group Name.  AA Name Swap with Last, First is the default. 95% of the time I do not have to enter anything to have this logic work. So, when I do have to manually enter a value, I want it to be very obvious where it goes.
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353

[Artist Sort] is not a calculated field, only [AA Name Swap] is.
Logged

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3119
Re: how to list and display artists in a "natural" order (like cds on a shelf)
« Reply #10 on: October 05, 2014, 06:37:35 pm »

I want a calculated field that I can put directly into a customized sort in category view. My Artist Sort field does that for me. I do not want another  logical expression in that sort. That is why I set up Artist Sort to be a calculated field that automatically updates. I can then use Artist Sort in my category sort.
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: how to list and display artists in a "natural" order (like cds on a shelf)
« Reply #11 on: October 05, 2014, 06:41:58 pm »

Got it. You just want a fixed field which does FirstNotEmpty([Artist Sort], [AA Name Swap]) rather than an expression column.
Logged

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3119
Re: how to list and display artists in a "natural" order (like cds on a shelf)
« Reply #12 on: October 05, 2014, 07:16:44 pm »

Bingo. I actually have yet another field that sets my sort field depending on whether it is classical (sort by composer) or  non-classical (sort by artist). So the artist sort field can then be used in that calculated field. It is just an intermediate, but makes things less messy.  With this fixed artist sort field, I made one change (artist to artist sort) and everything just worked. I use that sort field in about 15 category views, so changing the one field flowed  through to all the views easily.

Thanks for posting this. It has helped. I did not know that regex could reverse words. I am always happy to copy regex expressions from others :)
Logged
Pages: [1]   Go Up