INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: how to show the number of Artists / Albums / Tracks in a category  (Read 270 times)

baldo

  • Galactic Citizen
  • ****
  • Posts: 261

I have a field called Genres and I would like to see how many artists I have in each Genre.  Is this possible without having to click on each Genre and see the files that way.

I would just like one number for each Genre.

Many thanks
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2738
Re: how to show the number of Artists / Albums / Tracks in a category
« Reply #1 on: January 14, 2025, 04:50:32 pm »

Create a new view and add a Category of type "Expression" with:
expression to group = [genre]
expression to display = [genre] - GroupCount()

Logged

baldo

  • Galactic Citizen
  • ****
  • Posts: 261
Re: how to show the number of Artists / Albums / Tracks in a category
« Reply #2 on: January 14, 2025, 05:21:46 pm »

Perfect. Thanks for that super fast response. Did exactly what I was after.
Logged

HPBEME

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1117
  • Goodnight and Good Luck
Re: how to show the number of Artists / Albums / Tracks in a category
« Reply #3 on: January 14, 2025, 07:13:21 pm »

zybex always has the answers!

While his solution is great, I use another approach you or others, may be interested in.  I personally am not a fan of browsing via the tree, so I accomplish pretty much the same thing with a category view but display the pertinent info as text underneath a large thumbnail. 

If you or anyone is interested in adopting this approach, use the following for the thumbnail text:

Code: [Select]
<b><font size="130">[Name]<//font><//b><font size="90">
IF(isequal(groupcount(artist), 1, 5), (groupcount(artist) Artists, (groupcount(album) Artist) ~ IF(isequal(groupcount(album), 1, 5), groupcount(album) Albums, groupcount(album) Album))<//font>

Note: since I increase the font size 130% for the genre/sub genre name, you must set the number of thumbnail text lines to 3, otherwise the second line will be empty.  You can also change 130 in the above expression to 100 (or less), and it will display with 2 thumbnail text lines.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2738
Re: how to show the number of Artists / Albums / Tracks in a category
« Reply #4 on: January 15, 2025, 03:24:03 am »

Nice too :)

There is a typo in your expression, it says Album instead of Artist in one place. Your David Benoit thumbnail should likely be "1 Artist ~ 2 Albums" - notice it says "2 Artist", singular, due to the typo.

You can also optimize it to make the View faster by reducing the number of calls to the slow GroupCount() functions:

Code: [Select]
<b><font size="130">[Name]<//font><//b><font size="90">
save(groupcount(artist), _n1)/
save(groupcount(album), _n2)/
([_n1] Artist/##/if(isEqual([_n1],1),,s) ~ [_n2] Album/##/if(isEqual([_n2],1),,s))<//font>

The /##/ are just for readability and can be removed.
Logged

baldo

  • Galactic Citizen
  • ****
  • Posts: 261
Re: how to show the number of Artists / Albums / Tracks in a category
« Reply #5 on: January 15, 2025, 09:44:41 am »

HPBEME, Dude, that's even better than the tree view.  In fact I would  prefer that appraoch, even though the tree view serves the purpose that I orginally had.

Thanks for that code.  Can you walk me though how I use it please.  I'm not that familiar with using expressions like this.  If you can give me some screenshots that would be even better, but general pointers on what to click would be fine.

Thanks
Logged

baldo

  • Galactic Citizen
  • ****
  • Posts: 261
Re: how to show the number of Artists / Albums / Tracks in a category
« Reply #6 on: January 15, 2025, 10:11:42 am »

Btw, HPBEME, how do you get MC to show the waveform in the play bar at the top? 

I just have a straight line that gets filled in as the track is playing, I think you know what I mean.
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2046
Re: how to show the number of Artists / Albums / Tracks in a category
« Reply #7 on: January 15, 2025, 10:20:05 am »

Right click there and choose show waveform if available. To have it available you need to have enable analyze waveform in the options
Logged

HPBEME

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1117
  • Goodnight and Good Luck
Re: how to show the number of Artists / Albums / Tracks in a category
« Reply #8 on: January 15, 2025, 07:15:32 pm »

HPBEME, Dude, that's even better than the tree view.  In fact I would  prefer that appraoch, even though the tree view serves the purpose that I orginally had.
I definitely like it better than the Treeview approach, and I thought others would as well, which conveniently, you have now verified.  Hah!

That said, zybex correctly points out that my expression can be slow.  This is especially true where there are a lot of artists/albums - it can take a while to load, or even hang, as your drilling down.  So thank you zybex for providing a much better and more efficient expression - you are amazing!

Thanks for that code.  Can you walk me though how I use it please.  I'm not that familiar with using expressions like this.  If you can give me some screenshots that would be even better, but general pointers on what to click would be fine.
To add it to MC, use the code/expression from zybex's post (shown again below):
Code: [Select]
<b><font size="130">[Name]<//font><//b><font size="90">
save(groupcount(artist), _n1)/
save(groupcount(album), _n2)/
([_n1] Artist/##/if(isEqual([_n1],1),,s) ~ [_n2] Album/##/if(isEqual([_n2],1),,s))<//font>
and paste into the dialog box you get after selecting the items 1 thru 3 from the pic below. After that, go back to that same menu and this time choose Thumbnail text lines... (item 4 in the screenshot) and increase that count to 3, otherwise there is not enough room below the genre name to show the additional text (due to the 130% size for the genre name).

If you can give me some screenshots that would be even better, but general pointers on what to click would be fine.
I also feel strongly that screenshots are invaluable to ensuring guidance is clear and far less likely to be misinterpreted, which is why many of my posts include them, even though they are sometimes a bit tedious to produce. I am far from an expert myself - I just hack and slash on expressions provided by experts (like zybex) - between that and using zybex expression evaluator Zelda I can eventually get to where I want to go. I highly recommend downloading Zelda - you can find it on the third party software forum.

Btw, HPBEME, how do you get MC to show the waveform in the play bar at the top?
Exactly what lepa said.
Logged
Pages: [1]   Go Up