INTERACT FORUM

Please login or register.

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

Author Topic: Ignore articles (a, an, the) not working  (Read 5788 times)

Moe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 718
  • Hi
Ignore articles (a, an, the) not working
« 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:



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



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:



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.

Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42387
  • Shoes gone again!
Re: Ignore articles (a, an, the) not working
« Reply #1 on: June 13, 2011, 08:13:41 pm »

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(...)?
Logged
Matt Ashland, JRiver Media Center

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Ignore articles (a, an, the) not working
« Reply #2 on: June 13, 2011, 09:28:06 pm »

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.
Logged
The opinions I express represent my own folly.

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: Ignore articles (a, an, the) not working
« Reply #3 on: June 13, 2011, 10:26:20 pm »

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.
Logged

Moe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 718
  • Hi
Re: Ignore articles (a, an, the) not working
« Reply #4 on: June 14, 2011, 12:23:28 pm »

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.))
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Ignore articles (a, an, the) not working
« Reply #5 on: June 14, 2011, 12:33:16 pm »

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.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Ignore articles (a, an, the) not working
« Reply #6 on: June 14, 2011, 12:37:30 pm »

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.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42387
  • Shoes gone again!
Re: Ignore articles (a, an, the) not working
« Reply #7 on: June 14, 2011, 12:41:02 pm »

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)
Logged
Matt Ashland, JRiver Media Center

Moe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 718
  • Hi
Re: Ignore articles (a, an, the) not working
« Reply #8 on: June 14, 2011, 12:54:11 pm »

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.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Ignore articles (a, an, the) not working
« Reply #9 on: June 14, 2011, 02:30:13 pm »

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!
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/
Pages: [1]   Go Up