You’ll want to use the %ifdef function, which can check whether a flexible attribute is defined at all. (A normal %if just sees that $source expands to $source when the value is missing, which means the condition always appears to be true.)
> On Mar 24, 2017, at 6:39 PM, Bearcat Şándor <[email protected]> wrote: > > I have a flexible album field called source. I want to display the contents > of it in an album listing, if there is data in that field. It displays is > correctly if there is data in it, but incorrectly if there is not. > > Here's what i get with ls -a america > > America - 1975 - Hearts - [remastered from original master tapes]/ > America - 1976 - Hideaway - [$source] > > What i want is: > > > America - 1975 - Hearts - [remastered from original master tapes]/ > America - 1976 - Hideaway > > and so to that end i have > > format_album: $albumartist - $original_year - $album%if{$source, - [$source]} > in my config > > What am i doing wrong? > > Thanks, > > Bearcat > > > > -- > You received this message because you are subscribed to the Google Groups > "beets" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "beets" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
