Skip to main content
Topic: my Custom Column in Facets - help needed with coding etc. (Read 322 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

my Custom Column in Facets - help needed with coding etc.

In attempt to create a layout that helps me choose calssical music by composer and Rock, Jazz etc by Album_artists,  I creased a custom Column in Facets layout called "Composer/Band" and defined it as

Name                       Pattern
Composer/Band       $if($stricmp(%Genre%,"Classical"),$if(%Composer%,%Composer%,%Album artist%),%Album artist%)

Q1. Is the syntax correct?(used another message on this forum to write this). But I need help to modify it so that it says if the Genre is classical or Symphonic or Choral ... then if Composer exists then use composer. For all other genres or if the composer field is blank use Album_Artist.  How do I do this ?

Q2. My classical music Cds (Choral, Symphonic, Classicla vocal etc) were ripped to a directory on my computer H:Music\Classical. All non-classical music (Rock, Jazz, Blues etc) is in H:Music\RockJazz. Can I use the custom filed to display "Classical" (or Music\Classical) based on directory name? But for Rock/Jazz, I would like to display the actual Genre. Need help coding this.

Alternatively, if there a software I can use to rename the genre on all my Classicla music files to "simply "Classical" instead of sying Classical, Choral etc? Then I cn use the above code as is, if it is correct. Will you please advise of any software to do this enmass?

Q3.  My facets has the following columns in this order.
Genre, , Compuser/Band <- My custom column ' Conductor, ,Orchestra, Album, Album Artist.
There could be many Cds where the Conductor, Orchestra etc are blank. Do blank fields cause any issues with all Cds getting displayed by FoodBar Facets?

Thanks

Arun


Re: my Custom Column in Facets - help needed with coding etc.

Reply #1
On your Q1 try this:

Code: [Select]
$if($or(
  $stricmp(%Genre%,Classical),
    $stricmp(%Genre%,Symphonic),
  $stricmp(%Genre%,Choral)
  ),
  $if2(%Composer%,%Album artist%)
   ,%Album artist%)

Your syntax on your example was correct btw.


Q2  Not really sure what you're asking here. Just load your Classical directory into foobar and change genre to Classical.
Btw, choral and symphony is a more precise labeling of Classical. Imho I wouldn't remove that information to the more general Classical tag.

Re: my Custom Column in Facets - help needed with coding etc.

Reply #2
Hi there,

Q2. Facets can display folders (instead of tags) if you like, just right-click a column header and select Folder. But in this case better to leave it on %genre% I think. Facets cross-referencing works better the more specific tags you throw at it.

Q3. Blank fields can be dealt with thusly -
[%conductor%] = nothing shown unless field is present
%conductor% = shows '?' if not present
$if2(%conductor%,'['No Conductor']') = shows field if present, otherwise display [No Conductor]

Probably best to use either last two to ensure the Facets panes that follow still show everything available.

Also a note for multi-value fields -
%genre% = all values together on one row - "Rock, Jazz"
%<genre>% = one value per row - "Rock", "Jazz"

Cheers

Re: my Custom Column in Facets - help needed with coding etc.

Reply #3
Above code for custom field is not working. I put in the  Composer filed next to my custom "Composer/Band" field. The custom field seems to show Album artist in all cases. Does not matter if there is just one composer or multiple composers, Genre is Classical or Rock. Can I request you to see if you test it in your system, if it works for you.? I removed the second if clause and made it : $if($stricmp([%<Genre>%],"Classical"),%Composer%,%Album artist%). This still does not work.  Does stricmp work with a String Value in quotes? or does it only compare two fileds? Is there any other command to say "equals" a quoted string value?

Re: my Custom Column in Facets - help needed with coding etc.

Reply #4
Ok.. It appears that string value "Classical" should not be in quotes. Removing the quotes worked.

Re: my Custom Column in Facets - help needed with coding etc.

Reply #5
Use single quotes to escape syntax. If you need to use brackets for example - '('

Re: my Custom Column in Facets - help needed with coding etc.

Reply #6
Thank you Jazzthieve and Anamorphic.

Arun

Re: my Custom Column in Facets - help needed with coding etc.

Reply #7
I tried to re-do myinterface using CUI.

In the GUI design, I had the Genre and custom field Composer/Band field (If Genre=classical then composer else Album Artist)  on the top section of the screen in Facets (in addition to some other firleds) .(see above for code). It is linked to the playlist at the bottom of the screen.

For CUI, I designed the screen with "Filter" fields in the place of GUI's Facets at the top section of the screen and Playlist View at the bottom. This works fine except that I do not know where to put the code for displaying Composer or Album Artist depending on if the Genre is Classical or otherwise. Can you please help?

Re: my Custom Column in Facets - help needed with coding etc.

Reply #8
Please ignore my above question on CUI - Filters. It is just there in the most obvious place Filters - Fields.. but I guess, for all this time, I was too scared to touch it. Resolved.

 
SimplePortal 1.0.0 RC1 © 2008-2019