INTERACT FORUM
More => Old Versions => Media Center 16 (Development Ended) => Topic started by: Moe on June 13, 2011, 06:10:27 pm
-
Using MC 16.0.105
I am seeing some kind of strange behavior in Theater View regarding bands that start with "The", "A", etc.
Yes, I do have Ignore articles (a, an, the) checked under Options/Tree & View/Sorting
I have a view setup like this:
(http://www.moesrealm.com/mc/tview01.jpg)
The first expression is:
If(IsEqual(ABCDEFGHIJKLMNOPQRSTUVWXYZ, Left([Album Artist (auto)], 1), 8), Left([Album Artist (auto)], 1), 0-9 etc.)
The second expression is:
if(isequal([Genre],Soundtrack,1),Soundtrack,Compilation)
Album Artist (auto) and Album have not been modified in any way, they are just plain ol' library fields.
Now, when I go to the T's in Theater view at the beginning are all the "The" bands
(http://www.moesrealm.com/mc/tview02.jpg)
So, in a sense it's ignoring the "The" but it is still putting the artists under "T"
Scroll down past the "The" bands under T and you see:
(http://www.moesrealm.com/mc/tview03.jpg)
Any idea what the heck is going on? When I sort by Album Artist (auto) in standard views it correctly ignores the articles, just having this problem in my Theater View. It's quite possible that it's something I did while setting up the view, I still have problems with expressions.
-
You're using a complicated expression that puts words that start with 'The' under T.
Then inside that view, it sorts using the option to ignore articles since you have it checked.
So the results in your screenshot seem expected.
You could try to make the expression handle words that start with articles. Or you could make a new field with The at the end instead of the beginning and use that. Or you could just let 'The' sort under T's (my personal preference).
Maybe we should add an expression function RemoveArticles(...)?
-
Maybe we should add an expression function RemoveArticles(...)?
If so, maybe it could be parametrized to be multi-purposed :
1: removes a leading article
2: rotate article to the end of the string following a delimiter (Beatles, The)
Some time back, I thought it might be a good idea to allow the article list to be configurable via options. This function could then draw from those. Optionally, it could accept a list of articles to use instead or in addition to.
Just some thoughts.
-
You could try to make the expression handle words that start with articles...
...like this:
If(IsEqual(Left([Artist], 4), The ), Mid([Artist], 4, 1), If(IsEqual(ABCDEFGHIJKLMNOPQRSTUVWXYZ, Left([Artist], 1), 8 ), Left([Artist], 1), 0-9 etc.))
You make equivalent changes to handle "a" and "an"—I don't have any such artists.
-
Rick, you are the man! Thank you so much.
This is the expression I ended up with just in case someone else would find it handy.
If(IsEqual(Left([Album Artist (auto)], 4), The ), Mid([Album Artist (auto)], 4, 1), If(IsEqual(Left([Album Artist (auto)], 2), A ), Mid([Album Artist (auto)], 2, 1), If(IsEqual(ABCDEFGHIJKLMNOPQRSTUVWXYZ, Left([Album Artist (auto)], 1), 8 ), Left([Album Artist (auto)], 1), 0-9 etc.))
-
Maybe we should add an expression function RemoveArticles(...)?
This would be awesome. I use complicated If expressions (like the one rick crafted for the OP above) to do my Rename, Move, and Copy operations for this reason (because I want "The Decemberists" to be filed under the M:\music\D\ folder and not the M:\music\T\ folder). This would make those expressions much more readable and easier to craft.
-
Just a little tip... The way I've accomplished a similar task for my library was to make a calculated field called "Artist Letters" using a similar expression that Alex helped me with a while back. Then, I use this field in my Rename, Move, and Copy rules among other places. Using a calculated field instead of a "raw expression" makes it much more clear what a particular function actually does when you are using complex expressions in your View setups or Rename, Move, and Copy rules.
You can use the calculated fields basically as a way to "name" expressions and then re-use them via this name throughout the application.
-
I forgot that Clean(...) already offers the ability to remove articles. I updated the wiki:
http://wiki.jriver.com/index.php/Media_Center_expression_language#Clean.28....29:_Returns_a_cleaned_up_version_of_a_filled_in_template
So use:
Clean([Album Artist (auto)], 2)
-
What would be nice is if we could add words to the "Ignore articles (a, an, the)" command. For instance I have a couple bands that start with "Tha" and it would be nice if I could add the word "Tha" to the list to be ignored.
-
I forgot that Clean(...) already offers the ability to remove articles. I updated the wiki:
http://wiki.jriver.com/index.php/Media_Center_expression_language#Clean.28....29:_Returns_a_cleaned_up_version_of_a_filled_in_template
So use:
Clean([Album Artist (auto)], 2)
Nice!