Author Topic: How do you add tag values from multiple songs? (Time x PlayCount)  (Read 2856 times)

SonicRings

  • Sr. Member
  • ****
  • Posts: 277
I'm trying to be able to determine how much time I spent listening to certain songs based on multiplying their duration with the amount of times I played them. The Incredible Boom Boom helped me with the math part of it and I modified it to include hours in its display format here: https://getmusicbee.com/forum/index.php?topic=35695.msg195228#msg195228

However, I noticed that the play count it's using to multiply with the songs' combined duration remains static no matter how many songs I highlight. It keeps the first song's play count as the value and multiplies every other songs' durations by that value.

It treats every highlighted song as having, say, 3 plays, multiplying their lengths by 3, when in fact one could have 3 plays, another 6, and another 20.

How can I get it to calculate the songs' "time listened" using their own play counts? Here is the code I'm currently using:

Code
$Split($Div($Mul($Add($Mul($Pad($Split(<Time>,:,1),2),60),$Split(<Time>,:,2)),<Play Count>),3600),.,1) hours $Mod($Split($Div($Mul($Add($Mul($Pad($Split(<Time>,:,1),2),60),$Split(<Time>,:,2)),<Play Count>),60),.,1),60) minutes $Mod($Mul($Add($Mul($Pad($Split(<Time>,:,1),2),60),$Split(<Time>,:,2)),<Play Count>),60) seconds



As you can see in the image above, it's using a play count of 1 for both songs despite the second song actually having 0 plays. The time listened it should be displaying is thus 4 minutes 29 seconds, not 7 minutes 19 seconds.
Last Edit: November 01, 2021, 11:18:49 AM by SonicRings


SonicRings

  • Sr. Member
  • ****
  • Posts: 277
Is this the same question that you asked here:
https://getmusicbee.com/forum/index.php?topic=35695.0

and here?:
https://getmusicbee.com/forum/index.php?topic=3833.msg195206#msg195206

I'm trying to do the same thing yeah. I did already link to the first one so I'm not sure why you're linking that again lol. In the first one I was asking how to make the tag, now I'm asking how to make it work when highlighting multiple tracks.

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1014
  • Heal The World
This doesn't appear to be something that can be fixed from the user's side. As you noticed, for multiple files, MB does not treat <play count> the same way it treats <time>...difference being that the latter collects data from every selected track while the former only collects data from the first selected track. I don't know if that's intended or not. If it was not meant for <play count> to behave that way with multiple tracks, you can try reporting this as a bug. Then again, if it's intended to function that way, the only way forward for you would be to make a request for it in the wishlist section. Otherwise, I think you would miss out on that virtual tag of yours.
Last Edit: November 01, 2021, 11:35:59 PM by Mayibongwe
Favourite song at the moment:   Decode by Paramore

SonicRings

  • Sr. Member
  • ****
  • Posts: 277
This doesn't appear to be something that can be fixed from the user's side. As you noticed, for multiple files, MB does not treat <play count> the same way it treats <time>...difference being that the latter collects data from every selected track while the former only collects data from the first selected track. I don't know if that's intended or not. If it was not meant for <play count> to behave that way with multiple tracks, you can try reporting this as a bug. Then again, if it's intended to function that way, the only way forward for you would be to make a request for it in the wishlist section. Otherwise, I think you would miss out on that virtual tag of yours.

Good point. Yeah, I'm not sure whether or not it's intended either. I think I'll make a bug report later and if it indeed is intended I'll make a wish list request. Thanks for the suggestion.

Posted here: https://getmusicbee.com/forum/index.php?topic=35723.0
Last Edit: November 02, 2021, 04:28:14 AM by SonicRings

SonicRings

  • Sr. Member
  • ****
  • Posts: 277
Now that <play count> incorporates values from all the selected files when selected files are displayed in the track info panel https://getmusicbee.com/forum/index.php?topic=35730.msg195426#msg195426 I'd like to once again post this question, as I'm encountering a small hiccup with it.





Look at the green text in the right panel. As can be seen, the top track's 15 plays gives it a "time listened" of 29 mins 30 secs, while the bottom track's 6 plays gives it 22 mins 6 secs. However, now that the play counts add up, the calculation is now taking into account 21 plays and a duration of the two tracks combined lengths.

In this case, the "time listened" of 1 hour 59 mins 0 secs divided by 21 yields 5 mins 40 secs, which is the addition of 1:58 and 3:41 (the product is rounded up by a second apparently).

So, I'd like to know if there is a way to basically remember/store the product of each track's duration * play count. In this case, it should add the products of each track's "time listened" together, which would be 22 mins 6 secs + 29 mins 30 secs = 51 mins 36 secs.

Any help is greatly appreciated!
Last Edit: February 06, 2022, 01:33:18 PM by SonicRings