INTERACT FORUM

More => Old Versions => JRiver Media Center 27 for Windows => Topic started by: glynor on March 05, 2021, 10:15:50 am

Title: Search Language Issue: ~limit Doesn't Work With List-Type Fields
Post by: glynor on March 05, 2021, 10:15:50 am
In this recent thread (https://yabb.jriver.com/interact/index.php/topic,128796.0.html), 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.
Title: Re: Search Language Issue: ~limit Doesn't Work With List-Type Fields
Post by: zybex 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
Title: Re: Search Language Issue: ~limit Doesn't Work With List-Type Fields
Post by: Matt 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).