INTERACT FORUM

Please login or register.

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

Author Topic: Smartlist rule with Artist gets changed  (Read 2831 times)

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Smartlist rule with Artist gets changed
« on: May 23, 2015, 11:21:18 am »

As I mentioned in a previous posting, I'm building a SmartList to find Artists that start with "The" or end with "The".  This is pretty easy to do by entering a search into the search box:

[Artist]="the] or [Artist]=[the"

However, entering this into the Import/Export area of a SmartList doesn't work.  It gets rewritten to all manner of different things.  If you just enter one of the terms like:

[Artist]="the]

It will get translated to "Artist contains the", or:

[Artist]="the"

If you enter this into a Custom field, it will work for a moment, but as soon as you try to edit it, it will get rewritten again and lose it's definition.  Bug?  Feature?  Weird for sure.

Thanks,

Brian.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Smartlist rule with Artist gets changed
« Reply #1 on: May 23, 2015, 01:34:40 pm »

The Smartlist Editor uses brackets of different types to do odd things replicating the AND/OR/XOR functionality of the Search Language.  I don't understand it very well and never use that method (it is easier to just write them in the import/export dialog), but if you really want to know, I'm pretty sure Marko posted instructions once a long while back.  When you do something in the import/export dialog that isn't a valid Search Expression, it tries to translate it for you, but usually fails.

So, it is altering it because your search expression is not valid.  Without a full example, I can't say exactly why.  But I think it is getting confused by grouping.

But, I don't understand why you are doing this.

Tools > Options > Tree & View > Sorting > Ignore Articles
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: Smartlist rule with Artist gets changed
« Reply #2 on: May 23, 2015, 01:53:21 pm »

Actually, I investigated more...

It isn't because of grouping. It is because [Artist] is a list-type field.  List type fields, apparently, do not support the [text" or "text] notations to do begins-with and ends-with.  Probably because it would act upon the full semicolon-delimited list of names, and not the individual value elements.

For list-type fields, you can only do "contains" or "is" (or their not versions).

The other notation works fine on string-type fields.

Again, though, you don't need to do this to ignore articles.
Logged
"Some cultures are defined by their relationship to cheese."

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

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Re: Smartlist rule with Artist gets changed
« Reply #3 on: May 23, 2015, 03:40:11 pm »

If you want to try an example, try this.  In a view with a bunch of your music, enter this in the search field:

[Artist]=[The"

It will show you what you would expect.  I'm not sure how that interacts with List types, but it certainly works for my library.

Now to make it act weird.  Open a new SmartList.  Go to Edit, and hit the Import/Export button.  Enter the exact same text and press ok.  Watch it get transformed into something else.  Combining that with other terms makes it act REALLY wonky.

Now for the "why".  I'm going this to help me audit my library.  I would like to standardize all Artists that start with "The" into the form of "Artist, The".  I would also like to be able to transform an Artist field that is already in the form of "Artist, The" into "The Artist".  Combining two searches for The at the beginning, and The at the end lets me see both forms of these types of artists to evaluate them and change their metadata using a set of expressions I have written.  I hope that makes sense.  This ties into a post I made earlier today asking about saved expressions and SmartLists.

Thanks,

Brian.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Smartlist rule with Artist gets changed
« Reply #4 on: May 23, 2015, 04:12:25 pm »

If you want to try an example, try this.  In a view with a bunch of your music, enter this in the search field:

[Artist]=[The"

It will show you what you would expect.

So it does. This seems to be a bug or omission in the Smartlist Editor, then. Since there is no Starts With or Ends With "middle choice" in the Smartlist Editor (when the field is a List-Type field), it messes up the Search Expression when you exit out of the Import/Export wizard, and kicks it back to the default (which is always "contains").

Good catch.

However...

I would like to standardize all Artists that start with "The" into the form of "Artist, The".  I would also like to be able to transform an Artist field that is already in the form of "Artist, The" into "The Artist".

I would urge you to reconsider.

I did the same for many years, before we had a good, working Ignore Articles setting (and even long after, because I was stubborn). It is troublesome in a number of ways.

First, and perhaps most importantly, it forces you to manually re-tag all of your files every single time you get new stuff. None of the automatic metadata lookup systems are going to "bring in" fields matching that "Artist, the" system. No big deal, you might think, I tag everything anyway. But, it is just One More Step you have to do each time, and it really accomplishes very little.

And, it makes Links you add (for stuff like AMG lookups and Google Image Searches) less clever. Instead of taking you directly to the artist in question, they're going to show you a search results page. Of course, unless the search system on the external site is dumb, the correct result will be right at the top of the list, but still... It is way less clever than taking you directly to The Arcade Fire's page on AMG, or directly to the "right" result on SongMeanings (or whatever).

Likewise, it messes up the Cover Art lookup system, and makes you type in the box basically every time, or else a bunch of potential results are missing.

There are a bunch of other examples like this. Suffice to say... You're "fighting the system".  Don't fight the system when you don't have to.

Now... I bet I know why you want to do this.  Because of the filename paths on disk.  When you look them up on disk, you don't want The Arcade Fire to be filed with the "Ts" down near They Might Be Giants.  You want them under "A" on disk.  Yep, I'm with you.

I present to you the solution: [Artist Letters]

Make a custom Calculated Field called [Artist Letters] with this expression:
Code: [Select]
Regex([Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), 0 - 9, [R1])
If you prefer, you can easily modify it to use [Artist Album (Auto)] instead, of course. Use this in your Rename, Move, and Copy Files Directories Template to organize the files into folders like:



Ahhh.  ;)

You can do what you want, but... I'd strongly recommend wherever possible, don't fight the system unless forced. You're just making your system more difficult to maintain, more manual work for yourself, and risking "fiddly-ness" in the future.  Once I gave up and switched, I was very, very pleased with how much time it saved, and how it works. But, once I had a ton of things tagged with this "custom swapped article" system, it was painful to actually change them all.

PS. If you're more concerned about Views, note that you can add the [Artist] or [Artist Album (Auto)] field twice to the view, and set the Grouping size on the first one as desired to have MC auto-generate this:



Those "grouped categories" work in Standard, Theater, and Media Network Media Views.
Logged
"Some cultures are defined by their relationship to cheese."

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

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Re: Smartlist rule with Artist gets changed
« Reply #5 on: May 23, 2015, 04:23:06 pm »

Ok wow.  I didn't get what the ignore articles thing was for until you spelled it out and the considerations.  Luckily I still have my playlist that enumerates all of these artists, along with their Expression Columns to transform back and forth.  I actually already transformed all of my artists to "Artist, The" and was pretty satisfied with myself, until I read what you said!

So I used my other expression column that changes them back.  I enabled ignore articles and it works as it should.  Which is AWESOME actually!  Very happy to have all of them standardized in one way *AND* the sorting isn't broken.  Yay.  Thanks for the additional info.  I *might* use your Artist letters expression for disk.  I'm pretty hardcore about disk folders and files matching albums, but it doesn't have to be 100% to make me happy.  It just has to be very close and logical.  So maybe it's a cleanup task for another time.  I'm glad it's here for reference when I need it.

Thank you again.  :)

Oh and PS I got my SmartList rule working using Regex().  It's ugly-ish (as regex always is), but it works.  I no longer need it, but I know how to do it now. 

Brian.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Smartlist rule with Artist gets changed
« Reply #6 on: May 23, 2015, 04:40:12 pm »

Oh and PS I got my SmartList rule working using Regex().  It's ugly-ish (as regex always is), but it works.  I no longer need it, but I know how to do it now.

Yeah. If you insisted, that was going to be my suggestion until they fix the Smartlist Editor.
Logged
"Some cultures are defined by their relationship to cheese."

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