Author Topic: Can I use "duration" information in album properties in the formula as a tag?  (Read 1412 times)

hiccup

  • Sr. Member
  • ****
  • Posts: 7907
How can I do something that shows all the tracks in the ENTIRE LIBRARY tab but shows selected tracks in the MUSIC tab?
That sentence makes no sense to me. The music tab in your screenshot is already showing only 'selected' (filtered) tracks.
I'm out. Too much confusion for me.

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1282
I'm confused too.
Won't <Time> show the summation of the the selected tracks?
And <Album Duration> forgoes that to give the total length of the album?

tjinc

  • Sr. Member
  • ****
  • Posts: 333
Here is what I think is being requested and I am sorry sh88.arman if this is not correct:

You have a tab (called MUSIC) that displays a filtered subset of tracks from your library.
The filter rule is:  <check/uncheck> is Y

In this tab you are currently displaying <Album Duration> which shows the total album length, and you would like to display the total of the time of the tracks in the filter (per album).
As an example, in this screenshot, where it currently shows the album duration as 41:02 you want it to display the 'filtered album duration' which, in this case, would be 11:30, that being the sum of the three track times.


The best solution I can come up with for this requires 3 virtual tags:

Step 1 - Convert <Time> to number (seconds)
In order to calculate the sum of the track times we need to use the $Sum function. This will not work on <Track> field as it is not a number so create a virtual tag as follows:
label:        Time (secs)
formula:   $Add($Mul($Split(<Time>,:,1),60),$Split(<Time>,:,2))

Step 2 - Create a Filtered Album ID tag
In order to identify which tracks are in your filter we need to create an identifier tag as follows:
label:        Filtered Album
formula:   $If(<check/uncheck>=Y,Filtered-<Album>-<Album Artist>,)

Step 3 - Create Filtered Album Duration tag
This tag sums the required track times and also formats the results as mm:ss
label:        Filtered Album Duration
formula:   $Split($Div($Sum(<Time (secs)>,<Filtered Album>),60),.,1):$Pad($Mod($Sum(<Time (secs)>,<Filtered Album>),60),2)

You can then display the field <Filtered Album Duration> in place of <Album Duration>

Hope this helps.