Author Topic: <Play Count> doesn't collect data from every selected track  (Read 4106 times)

SonicRings

  • Sr. Member
  • ****
  • Posts: 267
Regarding my post here: https://getmusicbee.com/forum/index.php?topic=35718.msg195333#msg195333

I'm trying to make a virtual tag that calculates the time spent listening to the highlighted songs by multiplying the time of each song by the play count of each song.

However, the way the play count tag behaves, it remains static based on the first track you highlight, disregarding every subsequently highlighted track.



That's how the above happens: 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. Likewise, if I were to highlight the track with 0 plays first, and then highlight the track with 1 play, the time listened would still be 0.

I had a look at the "Configure Fields" options from the New Custom Tag Definition window, and noticed that <Time> was a string while <Play Count> was a number. So, I made a virtual tag where it was just <Play Count>, and made that virtual tag also a string, to no avail.

I'm guessing this is a bug? MusicBee can detect each songs' time no matter how many are highlighted, so I'd expect a consistent behaviour with other tags such as Play Count.

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 33284

SonicRings

  • Sr. Member
  • ****
  • Posts: 267
virtual tags only operate on a single file
<Time> and <Play Count> both are not virtual tags. Since I'm using two native tags to make calculations, shouldn't the virtual tag that's displaying that calculation work accordingly? I mean currently it does see multiple highlighted files; it just performs the wrong calculation because it thinks every files' play count is that of the first.

I think it's the play count tag that may be tripping this up, since in the track information box, it stays on the number the first highlighted file was at.

EDIT: Adding the virtual tag's code to the track information field itself behaves the same (below)

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
Last Edit: November 02, 2021, 11:22:25 AM by SonicRings

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 33284

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 429
If I [email protected] is actually onto something here. There is some inconsistency in the way MB treats native tags when dealing with multiple files. In the screenshot below, I have not used any virtual tags.

Notice how the tags are treated in both the details panel and the summary statistics.

Summary Stats
<Time> collected data from all selected files and accurately added their durations.
<Size> collected data from all selected files and accurately added their sizes.

Details Panel
<Time> collected data from all selected files and accurately added their durations.
<Size> however, did not collect data from all selected files. It only took the first.
<Play Count> behaves the same as <size>...It also does not collect data from all selected files

So what @SonicRings was asking here was if there's any chance <play count> (and size) could also be made to behave like <time>. That way, his virtual tag would accurately perform his calculation.

Bee-liever

  • Member
  • Hero Member
  • *****
  • Posts: 3768
  • MB Version: 3.5.8279 P
If I [email protected] is actually onto something here. There is some inconsistency in the way MB treats native tags when dealing with multiple files.
Yes Mayibongwe, it is inconsistent.
I would expect it not to work when using a virtual tag, but when using the track details panel and directly using the formula it should work when using the 'selected' tracks panel.
MB is currently summing the time and size, so why not playcount as well?
MusicBee and my library - Making bee-utiful music together

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 429
I would expect it not to work when using a virtual tag, but when directly using the formula it should work
I don't quite understand there. Isn't that the same thing? Whether I directly use a formula in the 'Track Info' panel or I use a virtual tag (e.g <virtual1>) to represent said formula defined in Tags(1), shouldn't either method work just the same?

Quote
MB is currently summing the time and size, so why not playcount as well?
Yeah. And to emphasize again, it only sums up size in the summary stats. For some reason, it does not do the same in the 'Track Info' panel.

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 33284
maybe you think it should behave a certain way but whether its a virtual tag or a formula directly in the track info panel, it only operates using one file.
Any summing done for multiple files for specific fields is because there is specific logic built in MB to do that but that is not supported otherwise.
You could add this to the wishlist

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 429
Thanks for the response and the clarification Steven. I only pointed out the inconsistencies to help @SonicRing's case. I'm sure he'll add this to the wishlist now that he (and myself) understand why play count does what it does (it's intended...something we weren't sure of in the previous thread linked at the top).

SonicRings

  • Sr. Member
  • ****
  • Posts: 267
If I [email protected] is actually onto something here. There is some inconsistency in the way MB treats native tags when dealing with multiple files. In the screenshot below, I have not used any virtual tags.

Notice how the tags are treated in both the details panel and the summary statistics.

Summary Stats
<Time> collected data from all selected files and accurately added their durations.
<Size> collected data from all selected files and accurately added their sizes.

Details Panel
<Time> collected data from all selected files and accurately added their durations.
<Size> however, did not collect data from all selected files. It only took the first.
<Play Count> behaves the same as <size>...It also does not collect data from all selected files

So what @SonicRings was asking here was if there's any chance <play count> (and size) could also be made to behave like <time>. That way, his virtual tag would accurately perform his calculation.
If I [email protected] is actually onto something here. There is some inconsistency in the way MB treats native tags when dealing with multiple files.
Yes Mayibongwe, it is inconsistent.
I would expect it not to work when using a virtual tag, but when using the track details panel and directly using the formula it should work when using the 'selected' tracks panel.
MB is currently summing the time and size, so why not playcount as well?
maybe you think it should behave a certain way but whether its a virtual tag or a formula directly in the track info panel, it only operates using one file.
Any summing done for multiple files for specific fields is because there is specific logic built in MB to do that but that is not supported otherwise.
You could add this to the wishlist

Thank you all for the responses! I've created a wishlist post here: https://getmusicbee.com/forum/index.php?topic=35730.0