1
Questions / Re: Different info in panel displays based on genre or other tag information
« on: June 02, 2025, 06:48:12 PM »I'll jump in. I have some time to kill this morning.
What I recommend, for anyone new to programming, is to write them out as separate macros and then combine them later.
Funny enough with your explanation of what you wanted you already provided it.
Macro1: $IsNull(<Album Library>,,Macro2)
Macro2: $If(<Album Library>=1,<Publisher> - <Genre>,Macro3)
Macro3: $If(<Album Library>=2,<Developer> - <Console> - <Sound Team> - <Original Album>,Macro4)
Macro4: $If(<Album Library>=3,<Comment> - <Publisher>,Macro5)
Macro5: $If(<Album Library>=4,<Work> - <Original Year>,)
First check if <Album Library> is null. If so output nothing. This takes care of the "unknown" problem. As you can see, highlighted in red, the false portion of each statement leads down to the next macro. This way all the different cases are checked. This is called nesting and is how you can arrange a binary output into a multiple output format.
From here you just have to combine them into the single statement it should be. For this step I prefer to work backwards. Cut-n-paste all of Macro5 into Macro4 at the appropriate spot and work your way up the chain until you are done.
$IsNull(<Album Library>,,$If(<Album Library>=1,<Publisher> - <Genre>,$If(<Album Library>=2,<Developer> - <Console> - <Sound Team> - <Original Album>,$If(<Album Library>=3,<Comment> - <Publisher>,$If(<Album Library>=4,<Work> - <Original Year>,)))))
This would be the final product. Call it something useful like TrackInfo and save it. Now you can add this to your header and remove all the other fields this handles. Hopefully I explained how to do this in a manner that will allow you to make any needed changes.
This is incredibly helpful and works super well. I really appreciate you taking the time to lay this out for me!
One small caveat though, in regard to the $IfNull function, I'm not so much concerned about whether or not the macros in question would display with "Unknown" if the Album Library field is empty, and am more concerned with the fields included *within* the macro returning empty fields as "Unknown".. and of course the formatting of the result in question.
For example, if I have an album in Album Library = 2 that doesn't include fields like Original Album or Sound Team, with this code it would return, say:
"HAL Laboratory - Super Nintendo - Unknown Sound Team - Unknown Original Album"
If I want to make the unknowns in these specific fields vanish, alongside the displayed text preceding them: " - ", how would I need to amend $IfNull for these macros?
Again, I want to make sure that the end result doesn't look like:
"HAL Laboratory - Super Nintendo - - "
and instead, would look like:
"HAL Laboratory - Super Nintendo"
Thank you so much again!