HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: kjn on 2024-03-21 15:47:15

Title: multivalue fields used in title formatting
Post by: kjn on 2024-03-21 15:47:15
Hello,

I want to sort the songs in the albumlist by genre and sometimes a song is tagged with multiple genres. To do this I made sure foobar sees the genre tag as a multivalue field, by adding it to preferences -> advanced -> display -> properties dialog -> multivalie fields.
Then I created a list of genres in the albumlist view with the following title formatting:

Code: [Select]
[%<genre>%]|%<artist>%|%title% '['%length%']'

This example works fine, songs are sorted by genre and songs with two genres are listed twice. But the list of genres tends to get very long and I wanted to shorten it by grouping the genres by their first letter:

Code: [Select]
$left([%<genre>%],1)|[%<genre>%]|%<artist>%|%title% '['%length%']'

The problem is that songs with two or more genres are omitted from this list. Is there a way to fix this? Or is this a limitation of title formatting?
Title: Re: multivalue fields used in title formatting
Post by: Bogozo on 2024-03-21 17:14:44
Try
Code: [Select]
[<$left(%genre%,1)>]
instead of
Code: [Select]
$left([%<genre>%],1)
Title: Re: multivalue fields used in title formatting
Post by: kjn on 2024-03-27 14:27:55
Hi,

Thanks for the help. I am now able to see the tracks with 2 or more genres as well.
Although it did not exactly do what I had in mind.

Take e.g. these 4 songs with genre metadata.
song 1: AOR; Hard Rock
song 2; Hard Rock; AOR
song 3: AOR
song 4: Ambient

Your solution gives this result.
Code: [Select]
$left([%<genre>%],1)|[%<genre>%]|%<artist>%|%title%
Code: [Select]
A--Ambient	  (song4)
 |-AOR   (song1, song3)
 |-Hard Rock   (song1)
H--AOR       (song2)
 |-Hard Rock (song2)
Songs with more than one genre are listed multiple times.
But what I wanted was this.
Code: [Select]
A--Ambient   (song4)
 |-AOR (song1, song2, song3)
H--Hard Rock (song1, song2)
Is this example possible with title formatting?

all the best,
kjn