INTERACT FORUM

Please login or register.

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

Author Topic: List Combining [Last Played] and [Number Plays]  (Read 2350 times)

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
List Combining [Last Played] and [Number Plays]
« on: March 11, 2021, 04:15:47 pm »

For a playlist to include files a) never played, and b) not played for 1 year (or more), I have tried to combine fields using this rule:

Code: [Select]
[Number Plays]=<1 [Last Played]=>1y
But these cancel out each other, because a file played (at least once) has no longer a value for [Last Played]...

So, I change the number of plays value to anything higher than 0:

Code: [Select]
[Number Plays]=<2 [Last Played]=>1y
This however wil exclude files that were played more than once... (And of course, a higher number will exclude files that were never played...)

Is there no way to include BOTH files that were never played AND those not played for 1 year? Thanks for your ideas!
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: List Combining [Last Played] and [Number Plays]
« Reply #1 on: March 11, 2021, 04:26:34 pm »

The search language uses boolean operators. You're thinking in terms of "and" but that's a misunderstanding of how boolean operators work.

What you need to do is "OR" your first two search terms.  An OR gives you the full results of two searches, whereas an AND gives you the results of the union, meaning only where both searches are true.

See the Grouping and Combining section of the search language wiki article:
https://wiki.jriver.com/index.php/Search_Language

Logged

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: List Combining [Last Played] and [Number Plays]
« Reply #2 on: March 11, 2021, 04:49:06 pm »

The search language uses boolean operators. (...) What you need to do is "OR" your first two search terms.  An OR gives you the full results of two searches, whereas an AND gives you the results of the union, meaning only where both searches are true.


Wow, thank you! I had heard of Boolean operators before, but often wondered if they work in MC at all... So my search expression is now:

Code: [Select]
([Last Played]=>1y or [Number Plays]=[])
... results are exactly as desired! That was very instructive, wish I had asked before... going to use this extensively -- thanks again! ;-)

Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: List Combining [Last Played] and [Number Plays]
« Reply #3 on: March 11, 2021, 04:56:23 pm »

Good, that's exactly right.

You were typing in search terms, and that's the way to use it there, but for anyone else looking I'll also give you a tip: it is also possible to use boolean operators and grouping when using the search wizard to build your rules.  The Wizard ANDs all rules by default.  But to quote myself from an old post:
Quote
You can also use parenthesis within the search wizard, but this feature is so hidden and undocumented it could be considered a prank.  If you hover your mouse in a secret area immediately to the left or right of a rule, you will see a tooltip appear telling you to use '(' to -OR- rules or '[' to -AND- rules by clicking.
Logged

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: List Combining [Last Played] and [Number Plays]
« Reply #4 on: March 11, 2021, 05:16:41 pm »

(...) "You can also use parenthesis within the search wizard, but this feature is so hidden and undocumented it could be considered a prank.  If you hover your mouse in a secret area immediately to the left or right of a rule, you will see a tooltip appear telling you to use '(' to -OR- rules or '[' to -AND- rules by clicking."

Wow, a true Easter Egg, well hidden at the far edges of search rule boxes -- not where you normally point your mouse... With each click adding different braces to the rule -- nice feature, only needs a button to make it more accessible... ;-)

Edit: The tooltip is badly mistranslated (German), I will contact the translator to get that fixed, so at least the accidental mouse hover shows useable information... ;-)
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: List Combining [Last Played] and [Number Plays]
« Reply #5 on: March 12, 2021, 04:45:11 pm »

Another idea -- can I also include files with number of plays between 0-1 (meaning 'not very often' ;-)?
I first tried this rule:

Code: [Select]
([Last Played]=>1y or [Number Plays]=0-1)
But "0-1" doesn't work, so I tried instead:

Code: [Select]
([Last Played]=>1y or [Number Plays]=[]-1)
The "[Number Plays]=[]-1" rule works, but now it cancels out the "[Last Played]=>1y" rule, so will include ANY file played 0-1 times regardless of WHEN it was played...

Any idea how to make that work, perhaps by reverse sorting the two rules (assuming they are processed in reading order 'left to right'), as in:

Code: [Select]
([Number Plays]=[]-1 or [Last Played]=>1y)
Sorry, I'm reluctant to try further before I understand the background (and because results may not show the difference right away)... Any insights appreciated, thanks ahead!

Edit #1: It seems I found out -- you have to add separate rules INTO the 'OR' braces to include files played 0, or 1-2 times etc:

Code: [Select]
([Last Played]=>1y or [Number Plays]=<2 or [Number Plays]=[])
Edit #2: This time I placed "[Last Played]=>1y" first, so to not get 'ruled out' by the others, but the order seems to make no difference for rules within the same 'OR' group... Is that so?

Anyway, seems to work so far (not yet tested via DLNA, so any comment is still welcome! ;-)
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: List Combining [Last Played] and [Number Plays]
« Reply #6 on: March 13, 2021, 02:14:56 pm »

Edit #1: It seems I found out -- you have to add separate rules INTO the 'OR' braces to include files played 0, or 1-2 times etc:

Code: [Select]
([Last Played]=>1y or [Number Plays]=<2 or [Number Plays]=[])
Edit #2: This time I placed "[Last Played]=>1y" first, (...) but the order seems to make no difference for rules within the same 'OR' group... Is that so?

Update to my prev. post -- sadly this didn't work either (just tested for DLNA), results included ANY number of plays...

Next attempt: combine only the last two rules that might be in conflict, like so:

Code: [Select]
[Last Played]=>1y ([Number Plays]=<2 or [Number Plays]=[])
This appears to get closer to the desired output... I still could use some help on this, would anyone be so kind?
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)
Pages: [1]   Go Up