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

SonicRings

  • Full Member
  • ***
  • Posts: 213
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

  • Full Member
  • ***
  • Posts: 213
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

  • Full Member
  • ***
  • Posts: 152
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

SonicRings

  • Full Member
  • ***
  • Posts: 213
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