INTERACT FORUM

Please login or register.

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

Author Topic: NEW: Improved Expression Language  (Read 4527 times)

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
NEW: Improved Expression Language
« on: April 28, 2020, 09:42:20 am »

Recently I started a thread asking for help expanding our expression language here:
https://yabb.jriver.com/interact/index.php/topic,124543.0.html

The expression language can be used most places in Media Center to customize what is displayed.

And it was really happy that I was just totally buried by great ideas.  Thank you!

As a result, we've had a lot of functions added.  Most are detailed in that thread.

Here's the history:
NEW: Added the IfCase(...) expression function ( details here: https://yabb.jriver.com/interact/index.php/topic,124543.msg866100.html#msg866100 ).
NEW: Added a ListMix(...) expression function (see this thread for details: https://yabb.jriver.com/interact/index.php/topic,124543.0.html)
NEW: Added a mode to the Find(...) expression function "2" to reverse find instead of forward find in the string.
NEW: Added the expression function GroupSummaryQuery to build a summary for files matching the given fields.
NEW: Added the expression function Letter(...) to output the starting letters of a string.
NEW: Added the expression function TrimLines(...) to standardize and consolidate newlines.
NEW: Added the Char(...) expression function to output a character from the numeric code of the character.
NEW: Added a SearchTags(...) expression function that takes a value and returns all the fields that have a match (the parameter after the value is an integer that when set to 1, just returns true or false for matches instead of the field names).
NEW: Added the expression function Number(...) that takes a string and finds the number (plus decimal) in the string.
NEW: Added the expression function Find(...) to search for a substring in a string.
NEW: Added the expression function Trim(...) to trim non-printable characters and newlines from a string.
NEW: Added the expression function ListFind(...) to search a list for a value (takes a final parameter to decide if it should return the value or the index).
NEW: Added the expression function Range(...) to create a numbered list.
NEW: Added the ListShuffle(...) expression function.
NEW: Added modes 9 (List search ANY (case sensitive)), 10 (List search ANY (case insensitive)), 11 (List search ALL (case sensitive)), and 12 (List search ALL (case insensitive)) to the IsEqual expression function.
NEW: Added modes 13 through 16 to IsEqual to do full string matching (instead of partial).
NEW: Added a GroupCountQuery(...) expression function to group files by a field, then count another field.
NEW: Added the expression function Or(...) to test a list of values and output true if any are set.
NEW: Added the expression function And(...) to test a list of values and output true if all are set.

Some of them really made us put on our thinking caps like the ListMix(...) function.  But it's been fun so thank you.

Enjoy :)
Logged
Matt Ashland, JRiver Media Center

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: NEW: Improved Expression Language
« Reply #1 on: April 28, 2020, 11:24:41 am »

As an example of the above, right-click a column header and pick "Add Expression Column..."

Then enter this expression using the new IfCase(...) function:
IfCase(Length([Name]), 5, 50, Wow this is super long, 30, This is a very long track name, 20, This is a long track name)

This looks at the length of the name of the track and switches based on the input.
Logged
Matt Ashland, JRiver Media Center

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72439
  • Where did I put my teeth?
Re: NEW: Improved Expression Language
« Reply #2 on: May 24, 2020, 06:17:42 am »

Logged
Pages: [1]   Go Up