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: Help with title formatting (Read 959 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Help with title formatting

Hi everyone,

Just wondering if someone could provide a bit of expertise regarding title formatting? I basically have three types of album that I'm trying to sort:

  • Albums with one album artist (i.e. normal album by a single entity)
  • Albums with multiple album artists (i.e. a collaborative album by more than one artist)
  • Albums with no album artists (i.e. compilation albums by different artists)

I'm trying to format the album list to split it into the above categories but my code-fu is badly failing me. I'm after something akin to the following pseudocode:

Code: [Select]
IF ALBUMARTIST > 1 THEN 'Multiple Album Artists', ELSE IF ALBUMARTIST = 1 THEN 'Albums', ELSE 'Compilations'

Whilst on the subject, if the above is possible to use in foobar2000, is it possible to separate multiple artists with commas and ampersands depending on if there's more than 2? (i.e. "Artist 1 & Artist 2", or "Artist 1, Artist 2 & Artist 3")

Any help you can offer would be most appreciated.  :)

Re: Help with title formatting

Reply #1
Use functions $meta_num() and $meta_sep() to get the number of artists and define a separator.

Code: [Select]
$if($or($strcmp(%album artist%,Various Artists),$not($meta(album artist))),'Compilations'|,$ifgreater($meta_num(album artist),1,'Multiple Album Artists','Albums')|[$meta_sep(album artist,', ',' & ')]|['['%date%']' ])%album%|[%tracknumber%. ]%title%

Code: [Select]
$meta_sep(album artist,', ',' & ')

Expand the formatting of the track title as needed.

 

Re: Help with title formatting

Reply #2
Thank you so much for your help, j7n.