INTERACT FORUM

Please login or register.

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

Author Topic: Small issue with display expression  (Read 951 times)

jsbenson

  • Recent member
  • *
  • Posts: 23
Small issue with display expression
« on: September 28, 2018, 09:01:02 pm »

I'm rebuilding my server after a crash, and can't seem to figure out what I'm doing wrong here.  I'm grouping by series, and in the group label I'm trying to display the film count in the title.  Using Star Wars (many titles), and Sucker Punch (single title) as examples

if(IsEmpty([Series, 1],0),[Name, 1],[Series, 1] /(GroupCount()/ Films)) results in:
Sucker Punch)
Star Wars (9 Films)


In this example, Star Wars is correct, but Sucker Punch has a trailing ")"

if(IsEmpty([Series, 1],0),[Name, 1],[Series, 1] /(GroupCount()/ Films) results in:
Sucker Punch
Star Wars (9 Films


In this example, Sucker Punch is correct, but Star Wars is missing the closing parenthesis

Thanks for the help.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9143
Re: Small issue with display expression
« Reply #1 on: September 29, 2018, 12:03:40 am »

I've not tested, but, your first example looks to be the correct expression. It looks to me as though you're missing an escape on the second last closing parenthesis.

That's the one you want MC to output literally, whilst the last one is the one that closes the expression off.

As it is, MC is using the second last one to close off the expression, then outputting the final one literally, in all cases.

if(IsEmpty([Series, 1],0),[Name, 1],[Series, 1] /(GroupCount()/ Films/))

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Small issue with display expression
« Reply #2 on: September 29, 2018, 12:32:36 am »

Marko beat me, but I tested!  :D

if(IsEmpty([Series, 1],0),[Name, 1],[Series, 1] /(GroupCount()/ Films))

You missed a "/" after "Films". Try;

if(IsEmpty([Series, 1],0),[Name, 1],[Series, 1] /(GroupCount()/ Films/))

That seems to work for me for Series and Non-series films.

It always helps me to count opening and closing brackets to see that they match. Some errors become obvious then. In this case, the escaped "(" confuses things.

if  (  IsEmpty  (  [Series, 1],0  )  ,[Name, 1],[Series, 1] /(  GroupCount  (  )  / Films  )  )

Or break out the expression, and again count brackets.

i.e.

if(    
    IsEmpty(
        [Series, 1],0   
    )
    ,[Name, 1],[Series, 1] /(
    GroupCount(   

    )
    / Films   
)   
)


Three opening brackets, four closing brackets. One closing bracket should have been escaped.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

jsbenson

  • Recent member
  • *
  • Posts: 23
Re: Small issue with display expression
« Reply #3 on: September 29, 2018, 10:28:39 am »

Right on!

Thanks for the help!
Logged
Pages: [1]   Go Up