INTERACT FORUM

Please login or register.

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

Author Topic: Rule to change existing database field tags, thus changing the display view.  (Read 1256 times)

DLewington

  • Guest
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42046
  • Shoes gone again!

Welcome.

You can build the categories in a view around an expression.

For the name / series thing you mention, an expression might look like:
If(IsEmpty([Series]), [Name], [Series])

But this actually exists already as a function (it does basically the same as the code above but is faster):
TVInfo(SeriesDisplay)
Logged
Matt Ashland, JRiver Media Center

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42046
  • Shoes gone again!

I think you're in the right place, adding an expression category to a view.

When I add:
If(IsEmpty([Series]), [Name], [Series])

I get a nice list of names and series.

You might switch the view to Panes, at least for the purposes of customizing because it'll make it a little easier to see.

You might also try some simple examples like [Name] or [Filename] just to see that it's doing what you expect.

Also, TVInfo(SeriesDisplay) will work for any media type.

Good luck :)
Logged
Matt Ashland, JRiver Media Center

DLewington

  • Guest
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42046
  • Shoes gone again!

A quick follow up question.
1) I never would have guessed that this would work for all media types, why isnt it specific to TV shows as the name implies?

Series is most often used for television, so that's how the function was named.

But that was only a naming choice, not a functionality limitation.



Quote
2) It displays a series name, and if there is none available it defaults to the name field apparently.Does this apply to other functions?

Each function defines its own behavior.

There's pretty good documentation here:
http://wiki.jriver.com/index.php/Media_Center_expression_language
Logged
Matt Ashland, JRiver Media Center

DLewington

  • Guest
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

When Matt adds new functions for essentially internal use, they are often made available in MC.  In this case, I believe the function was needed to more easily output the correct value for TV Series (e.g. use Name, unless Series) rather than use the longer and slower If() expression language equivalent.

So you can think of the function as For Matt's Use, but you can use it too.

Since these functions are essentially blackbox to us users, the documentation often lags in terms of clarity and accuracy.  I've updated the SeriesDisplay description a bit.
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up