Author Topic: It is possible to create a Top Artist using virtual Tags  (Read 1038 times)

Artesoll

  • Jr. Member
  • **
  • Posts: 29
It is possible to create a Top Artist using virtual Tags and upload it to the thumbnail browser?
As you can see I usei <Play Count> <Artist>, but it doesn't seem to work.


Is there a way to put this information in the sidebar with a thumbnail browser?
I'm doing something wrong in custom tags panel

Thanks

karbock

  • Sr. Member
  • ****
  • Posts: 552
Why it doesn't work
Let me first explain why your formula doesn't give the expected result.
In your screenshot, "0 Akcent" refers to all the tracks with Play Count = 0 by artist "Akcent".

Top Artists = <Play Count> <Artist>

gives, for each track, its play count followed by the artist's name. No values are summed up.
When you display Top Artists in the Thumbnail Browser (as in your screenshot), there is one entry for each combination of (Play Count, Artist).

What you can use

The key here is the $Sum function.

Virtual tag construction

Step
Formula, step-by-step
Comment
1
$Sum(<Play Count>,<Artist>)
total of <Play Count>, grouping by <Artist> (number only, but displayed as string)
2
$Pad($Sum(<Play Count>,<Artist>),4)
+ padded with zeros to have 4 digits (to enable a correct sort order)
3 (final)
$Pad($Sum(<Play Count>,<Artist>),4)|$Split(<Artist>,;,1)
+ artist name displayed
NOTE:
pretty bug without the $Split function -> all the artists after the first one will produce supplemental lines at the bottom of the list, with artist names only (without the total play count to the left)

Artesoll

  • Jr. Member
  • **
  • Posts: 29
It didn't work as I imagined, but I understand the concept, it's complex. the numbers become strange and random. For me, it would be easier if the program itself loaded the number of executions or the auto playlist in the thumbnail browser itself.


Thank you very much, now I know that I know almost nothing about this software. that I live on the surface. For me there are several limitations, be it language or age.  But I'll keep trying, because there are people like you willing to help.

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
It didn't work as I imagined, but I understand the concept, it's complex. the numbers become strange and random.
I don't know about "random", but as far as "strange" is concerned (if you mean the leading zeroes):
You can make it neater by making use of a zero width space instead.

$RxReplace($Pad($Sum(<Play Count>,<Artist>),4)|$Split(<Artist>,;,1),"0(?!|)","​")
Strength and Honour (2025)

Artesoll

  • Jr. Member
  • **
  • Posts: 29
Hello, Thanks for the reply.

When I say random, as you can see in the image, In the Library statistics, the most played artist is Sabrina carpeter and Schiller, The function does not follow an order, and these numbers are in different orders, even if I Sort by count or name.

And I believe there is no way to remove these numbers next to the artist's name or at least put them in an order

tjinc

  • Sr. Member
  • ****
  • Posts: 830
Hi Artesoll,

As long as you have the Additional Tagging and Reporting Tools plugin installed, you could try this virtual tag:

Code
$CharN(200b,$Sum(<Play Count>,<Artist>))<Artist>
No numbers, just the artist name but should sort in order of 'most number of plays', highest first. (You will still see the 'All' group at the top of the Thumbnail Browser.)

karbock

  • Sr. Member
  • ****
  • Posts: 552
Great ideas from tjinc (with the invisible character, unicode 200b)
and Mayinbongwe (to make it more readable)!

Maybongwe's formula needs two adaptations within RxReplace to work:
* escaping the | or enclosing it in square brackets
* adding a negative lookbehind, otherwise non-leading zeros are also replaced by spaces

This is the new formula, with -- in the same stride -- a user-friendlier separator:
Code
$RxReplace($Pad($Sum(<Play Count>,<Composer>),4)" → "$Split(<Composer>,;,1),"(?<![1-9])0(?! → )"," ")
@Artesoll, if you use the virtual tag in the Thumbnail explorer, use Sort by -> Name and Group by -> No grouping.
Sort by -> Count will sort by the album count computed for each entry, so in that case the list order won't match what you expect.
But I don't see why the order would be disturbed with Sort by -> Name and Group by -> No grouping.

In the Thumbnail explorer, sorting is done in ascending order only, thus lowest counts at the top, highest counts at the bottom.
However, descending order is possible in the column browser (highest counts at the top).

To illustrate the difference, you can find below a screenshot combining both options,
with 'PlayCountByComposer'.

Left pane = left main panel, thumbnail browser
Middle pane = main panel, column browser - vertical (stacked)
Right pane = main panel, files - Albums view
(Clicking on a column browser header, 'PlayCountByComposer' in this case, switches the sorting order: ascending/descending.)



EDIT: typo
Last Edit: October 19, 2024, 07:23:05 AM by karbock

tjinc

  • Sr. Member
  • ****
  • Posts: 830
This is the new formula, with -- in the same stride -- a more user-friendly separator:
Code
$RxReplace($Pad($Sum(<Play Count>,<Composer>),4)" → "$Split(<Composer>,;,1),"(?<![1-9])0(?! → )"," ")
One more tweak for this as the above will fall over when the artist play count gets to 1000 plays (that pesky middle zero).

I think this will do it:
Code
$RxReplace($Pad($Sum(<Play Count>,<Composer>),4)" → "$Split(<Composer>,;,1),"(?<![1-9]0*)0(?! → )"," ")

Artesoll

  • Jr. Member
  • **
  • Posts: 29
Hi Artesoll,

As long as you have the Additional Tagging and Reporting Tools plugin installed, you could try this virtual tag:

Code
$CharN(200b,$Sum(<Play Count>,<Artist>))<Artist>
No numbers, just the artist name but should sort in order of 'most number of plays', highest first. (You will still see the 'All' group at the top of the Thumbnail Browser.)

Thanks everyone - t worked perfectly.
This responds to an old wishlist request which was: Thambnail browser load autoplaylist, to precisely place the most played ones.

Now on the main page, we can display the most played artists in the library. Making things more dynamic.
Last Edit: October 18, 2024, 05:20:55 PM by Artesoll

karbock

  • Sr. Member
  • ****
  • Posts: 552
One more tweak for this as the above will fall over when the artist play count gets to 1000 plays (that pesky middle zero).

I think this will do it:
Code
$RxReplace($Pad($Sum(<Play Count>,<Composer>),4)" → "$Split(<Composer>,;,1),"(?<![1-9]0*)0(?! → )"," ")
Well spotted!

And I had forgotten to replace Composer by Artist in the published formula:
Code
$RxReplace($Pad($Sum(<Play Count>,<Artist>),4)" → "$Split(<Artist>,;,1),"(?<![1-9]0*)0(?! → )"," ")

tjinc

  • Sr. Member
  • ****
  • Posts: 830
And I had forgotten to replace Composer by Artist in the published formula:
Code
$RxReplace($Pad($Sum(<Play Count>,<Artist>),4)" → "$Split(<Artist>,;,1),"(?<![1-9]0*)0(?! → )"," ")
Actually this formula has a tendency to remove required zeros from the Artist name as well (9,990 of the '10,000 Maniacs' go missing!  ;D )

How about this:
Code
$RxReplace($Pad($Sum(<Play Count>,<Artist>),4)" → "$Split(<Artist>,;,1),"(?<![^0]0*)0(?! → )"," ")


(Sorry for dragging this out. I am only just beginning to get my head around RegEx and this example has proved to be useful practise for me.)

karbock

  • Sr. Member
  • ****
  • Posts: 552
How about this:
Code
$RxReplace($Pad($Sum(<Play Count>,<Artist>),4)" → "$Split(<Artist>,;,1),"(?<![^0]0*)0(?! → )"," ")
(Sorry for dragging this out. I am only just beginning to get my head around RegEx and this example has proved to be useful practise for me.)
Indeed, hat tip! And thanks for providing me with such brain teasers!