Author Topic: Total Artist Play Count as a Virtual Tag?  (Read 5302 times)

SonicRings

  • Sr. Member
  • ****
  • Posts: 256
Apologies if this is already explained somewhere. I did a cursory search and did not find it.



How can I get this value in a virtual tag? The Music Explorer tab displays the total artist play count below the artist name, but I can't seem to figure out how to display it anywhere else. I'm trying to make a virtual tag to include this value in my discordbee rich presence.

[Artist Track Count] shows the total number of tracks by the artist in my library, which is not what I want. I want the total play count of the artist.
Last Edit: September 25, 2021, 08:54:45 AM by SonicRings

psychoadept

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10613
You can't do this with a virutal tag, because virtual tags only apply to one track at a time. You might look at the additional tagging & reporting tools plugin, but I'm not sure if that will do it either.
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

SonicRings

  • Sr. Member
  • ****
  • Posts: 256
because virtual tags only apply to one track at a time
If that is the case, how come I can use the [Artist Track Count] tag? How is the total artist play count stat different from the total artist track count stat?

You might look at the additional tagging & reporting tools plugin, but I'm not sure if that will do it either.
Do you know if discordbee can use the tags created by this plugin?

psychoadept

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10613
If that is the case, how come I can use the [Artist Track Count] tag? How is the total artist play count stat different from the total artist track count stat?

That's an exception because it's a special tag already programmed into MusicBee.

Do you know if discordbee can use the tags created by this plugin?

I'm not familiar with discordbee, but the plugin writes tags to the file. If you can customize the tags shown by discordbee, it might be able to.
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 32736
i did something for this a while ago but trying now its not working so i will try and fix it
see the $Count (and $Sum) functions which should do what you want when i fix them

SonicRings

  • Sr. Member
  • ****
  • Posts: 256
i did something for this a while ago but trying now its not working so i will try and fix it
see the $Count (and $Sum) functions which should do what you want when i fix them
Awesome, thank you very much; looking forward to it!

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 32736
This should work now:
https://getmusicbee.com/patches/MusicBee34_Patched.zip
unzip and replace the existing musicbee application files

$Count(<album>) counts the number of files in the same album
$Count(<album>, <album artist>) counts the number of albums for an album artist
$Sum(<play count>, <album>) sums the total play count for all tracks in an album
$Sum(<play count>, <album artist>) sums the total play count for all tracks by an album artist

SonicRings

  • Sr. Member
  • ****
  • Posts: 256
This should work now:
https://getmusicbee.com/patches/MusicBee34_Patched.zip
unzip and replace the existing musicbee application files

$Count(<album>) counts the number of files in the same album
$Count(<album>, <album artist>) counts the number of albums for an album artist
$Sum(<play count>, <album>) sums the total play count for all tracks in an album
$Sum(<play count>, <album artist>) sums the total play count for all tracks by an album artist
Thanks a lot for the quick fix! This works great and does just what I want.

I'm seeing the count is a bit off for a few artists however, including the actual value shown in Music Explorer now that I'm looking more closely at it, and I'm not sure why. Do you have any ideas as to why that may be? It's still good to be able to have the artist play count with ballpark accuracy, but it's kinda weird to go from 2-3 off to over 100 (eg. Jonathan Young shows 338 scrobbles on last.fm, but the music explorer reports 437. I don't have any duplicate files for this artist.)

EDIT before even submitting the post:
Looks like the cause is that it's counting instances of the artist name that appear with multiple artists. Such as Jonathan Young & Galactikraken having 6 plays will add 6 plays to Jonathan Young. The album artist tag is Jonathan Young while the artist tags are Jonathan Young & Galactikraken.


I've added all instances of "Jonathan Young & additional artist" and it got me to 101, resulting in the 437 count (which is still off by 2 but that's probably due to a song or two not being in my library)

While this is cool, and I actually do prefer this and wish that last.fm also counted like this, is it at all possible to simply get the count of the artist name on its own, not including any instances of the artist being credited with additional artists in the artist/album artist tag?

EDIT after submitting post:
Oh, duh, I can just use <artist> instead of <album artist>. Excuse my last question haha. Looks like everything's good then!
Last Edit: September 26, 2021, 08:44:35 AM by SonicRings

SonicRings

  • Sr. Member
  • ****
  • Posts: 256
I seem to have encountered another issue: the total artist play count [ $Sum(<Play Count>,<Artist>) ] doesn't go up until musicbee is closed and reopened. If I listen to 5 tracks by Jonathan Young from my previous example, the number will stay where it started at.

Even if I listen to another song by another artist, and then go back to Jonathan Young, the count will still remain unchanged, despite it changing on last.fm.

It isn't until I close and reopen musicbee that the value gets updated.

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 32736
it uses the display artist value when you use <artist>
I cant see it working any other way ie. MB needs to show a single count or sum for the file in question so cant split out the artists. The music explorer can because its showing the data from a single artist point of view
<album artist> might make more sense to use

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 32736
This version will refresh the counter when the play count changes
https://getmusicbee.com/patches/MusicBee34_Patched.zip
unzip and replace the existing musicbee application files

psychoadept

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10613
Ha! Glad to find I'm wrong on this one.
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

SonicRings

  • Sr. Member
  • ****
  • Posts: 256
it uses the display artist value when you use <artist>
I cant see it working any other way ie. MB needs to show a single count or sum for the file in question so cant split out the artists. The music explorer can because its showing the data from a single artist point of view
<album artist> might make more sense to use
Oh don't get me wrong, the way <artist> currently works is the exact behaviour I'm looking for in this case. I was mostly trying to understand how the <album artist> one was getting a different number, which is very neat and I truly wish last.fm would also count like that, but since it doesn't, I do prefer <artist> for my current use case, since my goal is the display the same number my last.fm shows.

This version will refresh the counter when the play count changes
https://getmusicbee.com/patches/MusicBee34_Patched.zip
unzip and replace the existing musicbee application files

Thank you very much once again for fixing this, it now works great! The artist play count number goes up after each song now. I appreciate your prompt fixes as always, Steven!





So satisfying...
Last Edit: September 27, 2021, 01:57:37 AM by SonicRings

The Incredible Boom Boom

  • Hero Member
  • *****
  • Posts: 775
@SonicRings, how did you get these functions to work? I'm trying to use them in the Track Information panel, with no luck. Would you care to share your code?

SonicRings

  • Sr. Member
  • ****
  • Posts: 256
@SonicRings, how did you get these functions to work? I'm trying to use them in the Track Information panel, with no luck. Would you care to share your code?

Hi, my code for total artist plays is $Sum(<Play Count>,<Artist>)