Help - Search - Members - Calendar
Full Version: title formatting help
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Support - (fb2k)
splint3r
I've run into a bit of trouble formatting within an $if conditional and i wonder is there a known issue with using a | symbol in a $if then else statement.

what makes me think there might be is

VA|%album% works

$if($strcmp($substr(%directoryname%,1,2),VA),VA - %album%,%artist% - %title%) works. sends through VA -album name if its a various artists album and artist - title if not.

$if($strcmp($substr(%directoryname%,1,2),VA),VA|%album%,%artist%|%title%) doesn't work, this no longer sees 2 options and sends through VA album artist title for all files processed.

Can anyone shed some light?
foosion
Where do you use that (foobar2000 version and component)?
JoyO
Try quoting | with ' (single quotation mark).
splint3r
QUOTE(foosion @ Mar 5 2007, 23:06) *

Where do you use that (foobar2000 version and component)?


I'm using version 0.9.4.2 with the MediaBridge/Girder Plugin, the string is going into the configuration box to set up the media library root. Normally the | symbol denotes a new branch in the library tree.

QUOTE
Try quoting | with ' (single quotation mark).


I tried with a ' mark like '|' but it didn't fix anything
splint3r
I played around with it a little more and found if i put my test string into the Album List Panel configuration box it works just fine, for me this indicates its not an issue of the $if statement but more likely a problem for the plugin. I guess i'm on my own now....
sad.gif
splint3r
Well Well Well.....

I found the exact answers i needed in the 'Intermediate users guide', it even had an example!

The code that works includes the $if after every pipe.

CODE
$if($not($strcmp($substr(%directoryname%,1,2),VA)), %artist%)|$if($not($strcmp($substr(%directoryname%,1,2),VA)), %album%)|$if($not($strcmp($substr(%directoryname%,1,2),VA)), %tracknumber%. %title%)|$if($strcmp($substr(%directoryname%,1,2),VA), VA )|  $if($strcmp($substr(%directoryname%,1,2),VA), %album% )| $if($strcmp($substr(%directoryname%,1,2),VA),%tracknumber%. %artist% - %title%)


I only have one problem left and that is that it sends an empty branch at the end of every non VA track, i guess this is the last pipe before it starts failing the $if test so sends nothing.

My question is, is this a problem with my string? or something that needs to be fixed in the plug?

An answer might save me hours of heartache.
splint3r
The last problem was the spaces after the | in the code, took them out and the empty branches disappeared.

NICE!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.