Congrats on figuring it out! If you make some notes on what is happening with the formulas, you can refer back to them the next time you want to change something tag-based within MusicBee. And again, be sure to reference the Functions
page and the Additional Tagging & Reporting Tools functions
as well. The MusicBee function syntax itself is basic enough (with the only problem being it's difficult to read once you start getting to multiple lines, since there is no formatting) and understanding it will help when you notice something else you want to do. For example...
Then I copied & pasted the last code you put in the last message into my virtual tag and I still got the same format [mm:ss].
The $If() functions works like this... $If(Criteria,True Result,False Result)
In the code I initially gave you, the Criteria
is the check whether <Album Duration> is under one hour and if True Result
, then it just displays the <Album Duration> tag (which is why the format didn't change when you were looking at a 34 minute album.) You could see the changes take effect when looking at an album longer than an hour, because the $If() function had reached the False Result
So i just added a comma after "<1," and added ")" after "hours".
Now hopefully you can "see" how the $If(Criteria,True Result,False Result)
statement is giving you the result you want. Reading your code out loud will help ingrain it as well. If
the first split of <Album Duration> divided by 60 is less than 1,
(interpret this comma as the word "then") don't display anything,
(interpret this comma as the word "else") display the result of the first split of <Album Duration> divided by 60 then rounded down - display "hr:" - display the remainder of the first split of <Album Duration> divided by 60 then Pad
by 2 digits - display "min / " - display the second split of <Album Duration> - display " sec"
A mouthful, but crucial to being able to make future changes.
Thank you so much, man! I realize it might seem weird for me to get this worked up about this -and the solution was probably really obvious to a lot of users, to begin with- but honestly, I have so few wins in my life lately. [f*kin coronavirus]. And I think you gave me enough information to make me not want to literally rip my hair out but, I still feel like I was able to figure out the details myself and now I understand how & why it worked. Right now I feel a sense of accomplishment on par with that of killing a Dark Souls boss.
Not a problem, bro. I've never gone up against a Dark Souls boss, lol, but I understand the recent life frustrations and glad you've been able to find some confidence in even the little things!
Not sure if you're fully ok with the result you have now, but the below will give you exactly what you requested earlier. Look at the changes I made, see if you can understand the flow and let me know if you have any more questions about it. One more thing - try to always use quotation marks whenever you're displaying text.
$If($Div($Split(<Album Duration>,:,1),60)<1,,$RoundDown($Div($Split(<Album Duration>,:,1),60),0)" hour"$If($Pad($Split(<Album Duration>,:,1),3)>=120,"s",)", ")$Mod($Split(<Album Duration>,:,1),60)" minute"$If($Pad($Mod($Split(<Album Duration>,:,1),60),2)=01,,"s")