Author Topic: mmm.ss to hh:mm:ss  (Read 2671 times)

Loong

  • Guest
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...

ma_t14

  • Sr. Member
  • ****
  • Posts: 2493
I think the only way to go with this would be with a virtual tag and the use of 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...  ::)
Last Edit: July 03, 2014, 11:11:02 PM by ma_t14

boroda

  • Sr. Member
  • ****
  • Posts: 4595
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.