Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Formatting help - conditional display of song title/artist (Read 908 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Formatting help - conditional display of song title/artist

Hi all

I am trying to get NG Playlist to show track names just like the default user interface does, that is to say, display just the track name if %artist% is the same as %album artist%, but display '%title% / %artist%' if they differ.

The columns UI display code I am trying to use is something like
Code: [Select]
$if(%album artist%=%artist%,%title%,%title% / %artist%)


But I can find no reference on how to actually format conditional expressions. At the moment the condition here is ALWAYS returning TRUE, even if those values are not equal, so this always just returns %title%. So I essentially don't know how to compare two text strings to see whether they are the same (ifequal applies only to integers I believe).

Where am I going wrong/what would the code need to be to achieve what I'm talking about (which just means I don't need an Artist column)?

Many thanks


Formatting help - conditional display of song title/artist

Reply #2
I've solved this by using just
Code: [Select]
%title%[ / %track artist%]

- this was clear to me once I discovered that %track artist% only exists at all if %album artist% and %artist% differ, so this achieves exactly what I needed.

Still not sure why my previous test just didn't work though (returning TRUE even if it was in fact FALSE) so if you know why, please say. Cheers

edit: thanks - I had read the formatting reference but had not clicked that's what I needed or why the other comparison did not work.