IPB

Welcome Guest ( Log In | Register )

> foobar2000 General Forum Rules

This is NOT a tech support forum.
Tech support questions go to foobar2000 Tech Support forum instead.

See also: Hydrogenaudio Terms of Service.

 
Reply to this topicStart new topic
Formatting help - conditional display of song title/artist
Synchronated
post Mar 28 2012, 11:29
Post #1





Group: Members
Posts: 17
Joined: 15-January 09
Member No.: 65611



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
$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

This post has been edited by Synchronated: Mar 28 2012, 11:41
Go to the top of the page
+Quote Post
ruebe
post Mar 28 2012, 11:49
Post #2





Group: Members
Posts: 187
Joined: 18-September 10
Member No.: 83940



you have to use $strcmp()

$ifequal($strcmp(%album artist%,%artist%),1,%title%,%title% / %artist%)

to satisfy all your future title formatting needs:
http://wiki.hydrogenaudio.org/index.php?ti...ormat_Reference
Go to the top of the page
+Quote Post
Synchronated
post Mar 28 2012, 11:53
Post #3





Group: Members
Posts: 17
Joined: 15-January 09
Member No.: 65611



I've solved this by using just
CODE
%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.

This post has been edited by Synchronated: Mar 28 2012, 11:56
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th April 2014 - 05:57