Author Topic: Display length of my Audiobooks in HH:MM:SS  (Read 812 times)

Hanna

  • Jr. Member
  • **
  • Posts: 27
  • iTunes Refugee
I just started using MusicBee.
I noticed that duration of a track is always displayed in minutes, which is unsuitable if the number of minutes is more than an hour.
Is there a setting I can change or a different column to choose to get the time for long mp3s or m4bs to display in hours instead of minutes?

There is a long and very complex forum post and explanation of how to achieve this by modifying tags in a plugin.
I installed the plugin mentioned (ATT) and had an quick attempt. However, there are no real explanations/instructions and I don't understand the steps required to achieve the goal. I don't want to spend hours with trial-and-error for such a simple/basic thing.

Is there an easy way now, to change 600 minutes into 10 hours? Something I can achieve quickly without spending several days, like the guy who asked the question did? Or a step-by-step guide to follow?
The ATT plugin is too complicated, I don't understand how to use it.


MusicBee v3.2.6902.32258 (Win10.0), 9 Nov 2022 23:41:

System.IO.IOException: The process cannot access the file 'C:\Users\Hanna\AppData\Roaming\MusicBee\ASR Presets\85f0a00e-6d94-4ea2-8a41-e7ee73427121.ASR Preset.xml' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalDelete(String path, Boolean checkHost)
   at System.IO.File.Delete(String path)
   at MusicBeePlugin.AdvancedSearchAndReplaceCommand.saveSettings()
   at MusicBeePlugin.AdvancedSearchAndReplaceCommand.buttonCancel_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Last Edit: November 09, 2022, 09:44:53 PM by Hanna

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9346
Before going any further, I STRONGLY suggest you update MB as the issue may have already be addressed. The version you're using is four years old.

It's always best practice that before anyone reports what may be a bug, or a request for a new feature, that they use the most current version.
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

Hanna

  • Jr. Member
  • **
  • Posts: 27
  • iTunes Refugee
Before going any further, I STRONGLY suggest you update MB as the issue may have already be addressed. The version you're using is four years old.

It's always best practice that before anyone reports what may be a bug, or a request for a new feature, that they use the most current version.
i

I understand and had of course tried to upgrade -- it was a case of confusion regarding Store app vs regular app.
I have now again upgraded and the problem remains.Very long durations are displayed as minutes, i.e. 310 minutes, instead of 5:10:00
Last Edit: November 10, 2022, 06:24:54 AM by Hanna

Fox63

  • Jr. Member
  • **
  • Posts: 109
I have created a virtual field with this script.
The name of the field must be translated into the language in use.

Code
$If($Div($Split(<Durata album>,:,1),60)<1," 00 : "$Pad($Split(<Durata album>,:,1),2)" : "$Pad($Split(<Durata album>,:,2),2)," "$Pad($RoundDown($Div($Split(<Durata album>,:,1),60),0),2)" : "$Pad($Mod($Split(<Durata album>,:,1),60),2)" : "$Split(<Durata album>,:,2))

Hanna

  • Jr. Member
  • **
  • Posts: 27
  • iTunes Refugee
I have created a virtual field with this script.
The name of the field must be translated into the language in use.

Code
$If($Div($Split(<Durata album>,:,1),60)<1," 00 : "$Pad($Split(<Durata album>,:,1),2)" : "$Pad($Split(<Durata album>,:,2),2)," "$Pad($RoundDown($Div($Split(<Durata album>,:,1),60),0),2)" : "$Pad($Mod($Split(<Durata album>,:,1),60),2)" : "$Split(<Durata album>,:,2))

Thank you Fox!! :-*   That is impressive!  I see from the logic, what you have done, roughly - very elegant!   I'm using Music Bee in English, so I'll just change the "Album Duration" or whatever that field is.
Once I've implemented it, I'll post a screenshot to show you what it looks like, for a big audiobook collection like mine. :)

Please would you mind giving me a hint about WHERE to add this code?

I'm new to MusicBee... both the files, paths and interface. I feel completely lost.
I googled extensively to try to find the answer myself, but I did not find it...
Last Edit: November 10, 2022, 08:41:04 AM by Hanna

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34346
a screenshot showing where you are wanting to change the format will help people respond

Fox63

  • Jr. Member
  • **
  • Posts: 109
Go to:
1) Preferences
2) Tags (1)
3) Define new Tag

4) In the fields list, for example the number 1, put in the label the title of the field you want to give, for example duration in hours.
In formula you paste the script that I attached to you earlier by changing the field in Italian to that of your language.

So you have created a new field that you can use like the others.
I used it like this:


Hanna

  • Jr. Member
  • **
  • Posts: 27
  • iTunes Refugee
I'm almost there !!!     :-*
Thank you Fox!!

The calculation comes out a bit wrong for me, that's all. It looks like it's working for Fox63, so it's probably me that's doing something wrong. I'm trying to figure it out now, but I'm not as fast as you...

a screenshot showing where you are wanting to change the format will help people respond
Based on Steven's comment, I will clarify with two screenshots.

From itunes, see column TIME.
That is how I want it in MusicBee too, because it looks better if broken down into hours, for longer durations.
I.e. the duration displayed in Hours (hh:mm) if the duration is more than 59.59 minutes.



Here is what MusicBee looks like, after I implemented the code from Fox63.



As you can see, both Time and Album duration are displayed in minutes. It's not optimal for longer files.
(The Album Duration figure seems to do a clever calculation that includes everything else labelled with the same Album Name. Very nice and I don't think iTunes even does that. )

As you can see, it's almost there. Fox's explanation really helped me, I was feeling really overwhelmed when I looked at this late at night...

There is just something minor left now, with the calculation.


Could be at my end, because it looks like it's working for Fox63.

I discovered that both Time and Album Duration are String fields. I thought they'd be numerical or some Time format.
Once it's working correctly, I'll do dynamic custom fields based on this calculation for both Album Duration and Time. It's very nice and one up on iTunes!

For the code provided above. I simply did a replace for the Italian words, with "Time". Now it looks like this.

Code
$If($Div($Split(<Time>,:,1),60)<1," 00 : "$Pad($Split(<Time>,:,1),2)" : "$Pad($Split(<Time>,:,2),2)," "$Pad($RoundDown($Div($Split(<Time>,:,1),60),0),2)" : "$Pad($Mod($Split(<Time>,:,1),60),2)" : "$Split(<Time>,:,2))

Hope I'm being clearer and sorry if my thread wasn't optimal at start! :)  
Actually, MusicBee looks snazzier than iTunes!  just got to tweak it a bit... The learning curve is higher, that's all. It's not for n00bs and dummies!! tihi...
  :-*
Last Edit: November 10, 2022, 11:54:57 AM by Hanna

hiccup

  • Sr. Member
  • ****
  • Posts: 7856
Try this?:

Code
$If($Div($Split(<Time>,:,1),60)<1,<Time>,$RoundDown($Div($Split(<Time>,:,1),60),0):$Pad($Mod($Split(<Time>,:,1),60),2):$Split(<Time>,:,2))
(this needs a recent 3.5 version of MusicBee to work)

Hanna

  • Jr. Member
  • **
  • Posts: 27
  • iTunes Refugee
Try this?:

Code
$If($Div($Split(<Time>,:,1),60)<1,<Time>,$RoundDown($Div($Split(<Time>,:,1),60),0):$Pad($Mod($Split(<Time>,:,1),60),2):$Split(<Time>,:,2))
(this needs a recent 3.5 version of MusicBee to work)

Beautiful!  Big thanks Hiccup!  It works!!!  (after upgrade to Beta 3.5)     :-*    So I guess it worked for Fox because he too had 3.5 whereas I had got the latest official release, 3.4

Now it works!   I'll muck around a bit more with all this later today, but my initial problem is solved.
Next challenge is to figure out a good way to sync music and books with some Android apps.

Here is what it looks like now. For what it's worth, I think this behaviour is better than displaying minutes in the 100s or 1000s.   People prefer Time and Duration in Hours and minutes, for anything above 1 hour.




hiccup

  • Sr. Member
  • ****
  • Posts: 7856
Beautiful!  Big thanks Hiccup!  It works!!!  (after upgrade to Beta 3.5)     :-*     So I guess it worked for Fox because he too had 3.5 whereas I had got the latest official release, 3.4
Yes, his version will probably work for you now too.
(I think it pads the time to always use a 00:00:00 format)

some explanation on this:
Both formulas use the $Mod function, which was added to MusicBee pretty recent.
Before that you needed to have the Additional Tagging & Reporting Tools plugin installed to use it.
(many users have)

Hanna

  • Jr. Member
  • **
  • Posts: 27
  • iTunes Refugee
Beautiful!  Big thanks Hiccup!  It works!!!  (after upgrade to Beta 3.5)     :-*     So I guess it worked for Fox because he too had 3.5 whereas I had got the latest official release, 3.4
Yes, his version will probably work for you now too.
(I think it pads the time to always use a 00:00:00 format)

some explanation on this:
Both formulas use the $Mod function, which was added to MusicBee pretty recent.
Before that you needed to have the Additional Tagging & Reporting Tools plugin installed to use it.
(many users have)
Thanks for taking the time to explain! Seems like that was a powerful function added.  It would have taken me DAYS probably, to get that code right (i.e. it would never have happened) so I'm very grateful!

I actually HAD Additional Tagging, something installed, however I wasn't able to to figure out how to use it....
It's perfect now though!
I'm going to edit the name of the column and do some voodoo with the file tags later today.

Next, I'll configure MusicBee to sync to Android, and set up Smart Audiobook Player to work with this collection... And see if I can find some really good Music Player that works well with MusicBee....

Anyway, I'm so encouraged about getting help here, and finding a solution to the first glitch. I'm really liking MusicBee so far.
Last Edit: November 10, 2022, 12:37:27 PM by Hanna

hiccup

  • Sr. Member
  • ****
  • Posts: 7856
I actually HAD Additional Tagging, something installed, however I wasn't able to to figure out how to use it....
You probably installed a recent version of the plugin.
Recent versions of AT&RT had $Mod (and some other functions) removed after they were integrated in MusicBee (beta).

Another good example of making sure you always use the most recent versions of software and its plugins…

Check this if you want to learn more about MusicBee and AT&RT functions:
https://getmusicbee.com/forum/index.php?topic=35868.msg196257#msg196257
Last Edit: November 10, 2022, 12:52:41 PM by hiccup

Fox63

  • Jr. Member
  • **
  • Posts: 109
Quote
Beautiful!  Big thanks Hiccup!  It works!!!  (after upgrade to Beta 3.5)     :-*     So I guess it worked for Fox because he too had 3.5 whereas I had got the latest official release, 3.4
I'm glad that with the help of hiccups you managed to get what you wanted.
I forgot to ask you which version you were using because I'm used to always using the latest versions and I didn't think that the older versions were missing some commands, sorry.
Try to learn the commands on the page that linked you hiccups and you will be able to do many things.
It is not so much that I use MB (three months) but with the help of that page I managed to realize some of my ideas.
Good work

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34346
i have changed the behavior for the next v3.5 so it now shows hours when the time is >=60 minutes