INTERACT FORUM

Please login or register.

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

Author Topic: Search Language Issue: ~limit Doesn't Work With List-Type Fields  (Read 469 times)

glynor

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

In this recent thread, zybex and I discovered that the ~limit modifier doesn't work with List-Type fields "right" (or, at least, in the method that I think would be expected).

ISSUE:
~limit works on the full string entered for any List-Type fields, rather than on the individual list entries. Therefore, if you want to make (for example) a Smartlist with one random track from EVERY [Artist] in your Library, you can't if you use [Artist] as a list-type field.

That's because it will consider [Artist]=Taylor Swift;Bon Iver to be its own "discreet" artist. This means that file will ALWAYS be included in the results (assuming you only have one of them) rather than including that track in the "possible targets" for both Taylor Swift AND Bon Iver.

The ~limit modifier is basically designed exactly for this kind of task, so that seems pretty broken.

SOLUTION:
Can ~limit be changed so that it works properly with List Type fields? I can't imagine that people would want to actually limit it in the way it currently works with List-Type fields, but if you're concerned about that, another mode would be fine.

Alternatively, if anyone who knows the new fancy List-Type expression stuff and how it could combine with a Search modifier to work properly, please yell. I can't figure it out though because it makes my head hurt (and I suspect not). As I said, the current functionality is basically broken as documented in the wiki for its primary purpose though, so I think just fix it.
Logged
"Some cultures are defined by their relationship to cheese."

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

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2616
Re: Search Language Issue: ~limit Doesn't Work With List-Type Fields
« Reply #1 on: March 05, 2021, 01:08:08 pm »

I'm not sure this is doable. The results usually won't make sense.

Consider two movies with:
Movie 1: [Actors]=A;B;C
Movie 2: [Actors]=C;D;E

If you ask for "~Limit=-1,1,Actors", what do you want to see? Because of C being in both movies, the answer isn't simple.
- if it includes only Movie 1, there's no D and E on the list
- if it includes only Movie 2, there's no A and B on the list
- if it includes both, then C is repeated
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: Search Language Issue: ~limit Doesn't Work With List-Type Fields
« Reply #2 on: March 05, 2021, 01:35:16 pm »

Next build:

Changed: The ~limit search token will work better with list fields.

It just builds an array of the values so:
Matt; Abba
Abba; Matt

Will be one artist, and not add again.

If the lists aren't the same like:
Matt; Abba
Matt; Babba

They won't be considered the same.  I think that's right (enough).
Logged
Matt Ashland, JRiver Media Center
Pages: [1]   Go Up