INTERACT FORUM

Please login or register.

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

Author Topic: Display Text: user-defined fields on a Library Server  (Read 3651 times)

lowjoel

  • World Citizen
  • ***
  • Posts: 159
Display Text: user-defined fields on a Library Server
« on: May 18, 2012, 09:34:27 pm »

Quite a significant portion of my library comprises Japanese pop, with the normal Japanese titles, artists, albums etc. I used to keep the English names together with the Japanese native names in the Name field... which was nice and fine until I started using Last.fm and picked up some Japanese. So I'm now intending to get all my tags back to follow the Japanese names, and storing the English names as a separate user defined field.

Since I'm still not too... fluent in the language, I figured I'd display the English names (I call it the Transliterated Name field) on the display if one is present in the tags. This works on my local library when the Transliterated Name field is defined. Connecting a Media Server however would cause the entire If statement to trip and display the expression string verbatim.

This is my Display Text:

[Name]If(IsEmpty([Transliterated Name]),,/ /([Transliterated Name]/)) ([Artist] - [Album])

So I'll have 花守の丘 (Hanamori no Oka) (FictionJunction - FictionJunction: Yuki Kajiura Live Vol.#4 Part II: Everlasting Songs Tour 2009) on my machine, but 花守の丘 ([Transliterated Name]) (FictionJunction - FictionJunction: Yuki Kajiura Live Vol.#4 Part II: Everlasting Songs Tour 2009) when connected to the library server.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Display Text: user-defined fields on a Library Server
« Reply #1 on: May 18, 2012, 10:53:03 pm »

I'm not seeing this here, but the symptoms seem to indicate the client don't see [Transliterated Name] as a field.  Perhaps you need to restart the client?

Btw. you should escape the last set of parens:

[Name]If(IsEmpty([Transliterated Name]),,/ /([Transliterated Name]/)) /([Artist] - [Album]/)
Logged
The opinions I express represent my own folly.

lowjoel

  • World Citizen
  • ***
  • Posts: 159
Re: Display Text: user-defined fields on a Library Server
« Reply #2 on: May 18, 2012, 11:22:58 pm »

Escaping the last two parentheses didn't help... and those were actually from the stock messages.

I think I should clarify. My local library has the Transliterated Name field. The server which my client is connecting to does not. So it's a field defined on my client but not on the server.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Display Text: user-defined fields on a Library Server
« Reply #3 on: May 18, 2012, 11:29:10 pm »

[ I removed my previous reply, since I misread and the response didn't make sense.]

When there is no field defined, MC treats any [missing field] as plain text, so that's what you'll see.
Logged
The opinions I express represent my own folly.

lowjoel

  • World Citizen
  • ***
  • Posts: 159
Re: Display Text: user-defined fields on a Library Server
« Reply #4 on: May 18, 2012, 11:33:13 pm »

I pretty much guessed that. Any way to short-circuit the logic? Is there a defined() function or something like that? Empty here obviously doesn't work...
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Display Text: user-defined fields on a Library Server
« Reply #5 on: May 18, 2012, 11:58:34 pm »

Sure.  Test for IsEmpty() AND not IsEqual([Transliterated Name], /[Transliterated Name/])

See also: http://wiki.jriver.com/index.php/Database_Expressions_AND_OR_And_XOR
Logged
The opinions I express represent my own folly.

lowjoel

  • World Citizen
  • ***
  • Posts: 159
Re: Display Text: user-defined fields on a Library Server
« Reply #6 on: May 21, 2012, 06:20:38 pm »

Alright, thanks.
Logged

lowjoel

  • World Citizen
  • ***
  • Posts: 159
Re: Display Text: user-defined fields on a Library Server
« Reply #7 on: May 21, 2012, 06:27:56 pm »

Oh, it does seem that the | operator doesn't work in the Display Text field. The expression gets cut off after the pipe.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Display Text: user-defined fields on a Library Server
« Reply #8 on: May 21, 2012, 06:34:01 pm »

Oh, it does seem that the | operator doesn't work in the Display Text field. The expression gets cut off after the pipe.

Confirmed. I'll report it.
Logged
The opinions I express represent my own folly.

lowjoel

  • World Citizen
  • ***
  • Posts: 159
Re: Display Text: user-defined fields on a Library Server
« Reply #9 on: May 21, 2012, 06:35:01 pm »

Thanks again.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Display Text: user-defined fields on a Library Server
« Reply #10 on: May 23, 2012, 01:41:39 pm »

Oh, it does seem that the | operator doesn't work in the Display Text field. The expression gets cut off after the pipe.

Update: This is a limitation due to some old code that uses | as a separator.  Until this is fixed someday to use the current expression evaluator code, use one of the alternate techniques to perform OR operations for customizing the Display Text.
Logged
The opinions I express represent my own folly.

lowjoel

  • World Citizen
  • ***
  • Posts: 159
Re: Display Text: user-defined fields on a Library Server
« Reply #11 on: May 23, 2012, 06:49:39 pm »

Heh, I'm guessing only those familiar with assembly would associate + with boolean OR; and * with boolean AND :P

Thanks anyway.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Display Text: user-defined fields on a Library Server
« Reply #12 on: May 23, 2012, 07:01:20 pm »

Yeah, probably.  Use the nested If() version.
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up