Author Topic: $IsNull with <Album Artist>  (Read 635 times)

hegyre

  • Newbie
  • *
  • Posts: 4
Hello!

I'm following the tutorial for the templates, which is nicely explained (https://getmusicbee.com/forum/index.php?topic=10980.0#)

However, I'm having an issue when using $IsNull with <Album Artist>.

Without $IsNull, it's working properly:


But below, with $IsNull, see the 3 last, they are displaying "text" instead of the Album Artist, despite it's found...


Not sure if this is only with this specific function, or if it's an issue with the tag itself, but only 1% of my files are displaying it correctly.
I've tested with <Artist> and I don't have this issue (however it's the <Album Artist> that I want here...)

Best,
hegyre

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2463
This is probably because if Album Artist is missing, MusicBee will substitute Artist instead.
My guess is that it's doing this for the values shown in the Album Artist column in the preview list.

If you check one of those last three files in the Tag Editor, do they actually have a value in the Album Artist tag, or is it missing (null)?
Bee excellent to each other...

hegyre

  • Newbie
  • *
  • Posts: 4
Yes you're right, for the 3 last, the <Album Artist> tag is missing in the Tag editor, whilst it's there for the first 2.

But then, why the behavior is different ? I mean, why if <Album Artist> is missing, MusicBee will substitute <Artist> , but that happens only if not used in a function ? Is that really the intended behavior ? and is it documented somewhere ?

Edit: I've tested with $Len(<Album Artist>) and $Lower(<Album Artist>), for both, the substitution is done to <Artist>, so my guess is that this is specific to the $isNull() function.

Edit2: TBH, that's actually nice since $isNull is specifically made to test a null/empty tag.
In fact, "$IsNull(<Album Artist>,<Artist>,<Album Artist>)" is actually the same as just <Album Artist>
Last Edit: August 25, 2022, 09:48:45 PM by hegyre