More > JRiver Media Center 26 for Windows

NEW: ItemCount(...) expression

(1/4) > >>

Matt:
Coming soon to MC25 is a new expression function ItemCount(...).

It provides the count of whatever expression you put in as a parameter in the library.

So let's say you specify:
ItemCount(/[Album/])

You'll get the count of files in the album.

You can also use expressions like:
ItemCount(AlbumKey/(/))

That expression gets the count of files in the album (smart handling of duplicate album names, etc.)

This came from the requests in this thread:
https://yabb.jriver.com/interact/index.php/topic,122303.0.html

Originally we thought it might be too slow, but now we cache the results and rebuild the cache each minute (so a fresh import might not show for a minute).

Enjoy :)

RoderickGI:
Hmmm, these seem to require a different syntax to what I am used to, since you are including escape characters inside the function.

Okay, I read the thread discussing this. I havent' been drinking whiskey, but I still don't understand the nuance of why escape characters are required. After all, we use functions inside functions all the time in Expressions, such as the simple;

if(isequal([artist], bob dylan, 1), Genius, Mediocre)

The () for isequal don't need escaping. So why does Albumkey()?

I get what the escaping does, passing the literal "Albumkey()" to the ItemCount() function, but how is that different to the isequal()?

I assume that what you want to do is pass the literal, and not evaluate the function, or in the case of /[Album/] field first. But I'm not sure why.  ?

Sorry. I'm not really a programmer.  :o

RoderickGI:
Now I'm even more confused. No escape characters used in this example:


--- Quote from: Matt on September 24, 2019, 06:36:34 pm ---I'm wondering about:
ItemCount(AlbumKey() - [Disc #])


I'll test tomorrow and reply here.
--- End quote ---

ferday:
this could be a highly interesting feature. 

Matt:
You need to escape because otherwise it just evaluates the value of AlbumKey() or whatever and replaces the text with the value.  Instead you need to pass that actual string like AlbumKey() to the function so it can use it.

Does that make sense?

Navigation

[0] Message Index

[#] Next page

Go to full version