getmusicbee.com

Support => Questions => Topic started by: Loong on July 03, 2014, 04:32:55 PM

Title: mmm.ss to hh:mm:ss
Post by: Loong on July 03, 2014, 04:32:55 PM
Greetings guys, how to format track duration from "mmm.ss" to "hh:mm:ss"  in <time> column (or in some virtual tag, or whatever)  ???
$Date() function not helped...
Title: Re: mmm.ss to hh:mm:ss
Post by: ma_t14 on July 03, 2014, 06:02:02 PM
I think the only way to go with this would be with a virtual tag and the use of functions (http://musicbee.wikia.com/wiki/Functions)

Even then though I think it would be either impossible or highly complicated since the currently available functions are kind of limited.

The furthest I managed to go was this:

$If($Contains("("$If($Contains($Left(<Time>,2),:),true-value,<Time>)")",<Time>),$If($Left(<Time>,2)>59,success,<Time>),<Time>)

...which returns "success" when the time of a track exceeds one hour, otherwise returns the time as normal. But it is limited to tracks with length smaller than 99 minutes.

This limitation stems from the fact that the split function returns text. If there was a way to convert the output to an integer it would make things much easier as it would allow for <, >, == comparisons. Extracting the minutes from the <time> tag is as simple as the following:

$Split(<Time>,:,1)

...but you can't really do anything with the output as there is no way, that I am aware of anyway, to convert it to a type of integer.

Another feasible solution would be to use the left() function, which already returns an integer, but you would still need an additional function e.g. len() to extract the length of $Split(<Time>,:,1) and then use that as the offset for the left() function.

Maybe someone more clever though can come up with a solution with what is already available...  ::)
Title: Re: mmm.ss to hh:mm:ss
Post by: boroda on July 03, 2014, 07:21:12 PM
Try this plugin:
http://musicbee.wikia.com/wiki/Additional_Tagging_and_Reporting_Tools

'Advanced Search and Replace' command, 'Convert 'mmm:ss' in '<Tag 1>' to 'hh:mm:ss' in '<Tag 2>'' preset.