INTERACT FORUM

More => Old Versions => JRiver Media Center 29 for Windows => Topic started by: Scolex on April 25, 2022, 04:40:45 pm

Title: Possible to Restrict Calculated Library Field
Post by: Scolex on April 25, 2022, 04:40:45 pm
I am wondering if it is possible to create a calculated library field and give it more restrictions than just media type.
To be more specific I have a rather large collection of artist images that I would like to sort by aspect ratio.
Something similar to this.
[Media Type]=[Image] [Genre]=[Artist Images] ([Width]/[Height])=[Aspect:]
Keep in mind expressions might as well be written in Sanskrit so I have no idea how to format the expression.
I would also like to limit the output to 2 decimal places.
Title: Re: Possible to Restrict Calculated Library Field
Post by: zybex on April 26, 2022, 06:22:18 am
You don't need to filter. This expression gives you the aspect ratio for any file that has a [height] defined, so it works for images and videos:

Code: [Select]
if(not(isempty([height])),math(trunc([width]//[height],2)),)
Title: Re: Possible to Restrict Calculated Library Field
Post by: Scolex on April 26, 2022, 08:02:49 am
You don't need to filter. This expression gives you the aspect ratio for any file that has a [height] defined, so it works for images and videos:

Code: [Select]
if(not(isempty([height])),math(trunc([width]//[height],2)),)

Thank you it worked flawlessly!
After I posted I did a little reading and if I understand correctly something like this is an on demand calculation so it's only calculated when you are viewing that tag. Due to that fact assuming I am correct I don't need to be concerned with it doing the calc on 10s of thousands of files since I will only be viewing it in smartlists that reduce the number of files greatly.
Title: Re: Possible to Restrict Calculated Library Field
Post by: zybex on April 26, 2022, 08:04:13 am
That is correct.