Author Topic: Is there a way to get a count of songs per album in a playlist?  (Read 1204 times)

frankz

  • Hero Member
  • *****
  • Posts: 3290
I'm looking for a way to get a list of albums in a (static) playlist and then the number of songs from each album that are in the playlist.

Basically: <Album>, <Count in Playlist>

to ultimately get <Album>,<Count in Playlist>/<Album Track Count>

There's an explanation why, but I'm sure it's uninteresting to anyone but me.  

I've looked at it for a couple of days and either I'm not smart enough to figure out a way or it's not doable.

I could export <Album>,<Album Track Count> from the playlist and then have a spreadsheet count how many lines show up for each album and do it that way, but that involves deleting a lot of duplicate rows to get a neat report.

I'll do that if there's no native way - this isn't a wishlist request and I probably could have done that 15 times in the time I've spent trying to avoid it. 
Last Edit: June 15, 2020, 08:22:28 PM by frankz
A smile is happiness you'll find right under your nose.

psychoadept

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10675
I don't even know of a way to get the total number of tracks in a playlist in that sense, sorry.
MusicBee Wiki
Use & improve MusicBee's documentation!

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

frankz

  • Hero Member
  • *****
  • Posts: 3290
I figured I'd come back and update about how I wound up accomplishing this, partly in case anyone wants to do something similar in the future, partially to give some information about ways people can work with their MB data outside of MB, and partially in case I want to do something like this in the future but can't remember how i did it.

Here's the long-winded back-story:
I'm in the process of upgrading some of my library from MP3 to FLAC.  The decision to swap in the FLACs that I had sitting on my computer as archival copies was a no brainer for the space saving aspect.  Somewhere along the line something very bad happened: I realized I could hear a difference between the FLACs and my Lame -V0 MP3s. Not a huge difference, but a difference.  A little more "presence" - a little less distortion in the cymbal crashes - a little more depth of field.

Once that happened, I realized I was going to have to "rerip" (LOL) some of the more "important" albums that I didn't originally save in FLAC to FLAC.  At that point, it became a space calculation.  I wanted to focus on things I was actually going to wind up listening to the most.  My library is set up as a "library" (everything) and a playlist that is my listening library - Tracks from albums in the library that I want to hear.  Everything I listen to is derived from that playlist. I wanted to find out which albums in my library had the highest percentage of tracks that wound up in the Listening Library playlist.  My "rerip" (LOL) list would be limited to albums with more than 70% of their tracks in the playlist.

Here's how I accomplished it:

In Musicbee:
1. Set up a filter - Playlist is Listening Library and Type is MP3 and Album Track Count > 9 (to weed out singles and EPs)
2. Filter Library and select all tracks
3. Edit->Edit Preferences->Tags(2)...'send to clipboard' tags: '<Album Artist>';'<Album>';'<Album Artist> <Album>';<Album Track Count>

The third field is to give me a unique key in case there are multiple artists with identically named albums. This way I can still sort by artist or album as needed.

4. Right Click->Send To->Clipboard

I use Libre Calc for my spreadsheet needs.

In Libre Calc
1. Edit->Paste

This opens up the text import dialogue.

Separator Option: Semicolon - String Delimiter: '

Now there are 4 columns A-D and one row for each song in the playlist that meets the playlist criteria.

2. Column E is a formula =COUNTIF(C:C,C1)  Copy this to all rows.

This counts each row where the <Album Artist> <Album> field equals the one in this row.  In other words, how many songs in the list come from this album.  

3. Copy this Column E result to a new column and paste as a number, so that if there are any changes in the spreadsheet there is no change to the result.  Then delete the original E and this becomes E
4. Column F is a formula =(E1/D1).  This gives you the ratio of playlist tracks to album tracks, one row for each song in the playlist.
5. Copy this Column F result to a new column and paste as a number, so that if there are any changes in the spreadsheet there is no change to the result.  Then delete the original F and this becomes F.
6. Change the format of F to a percentage.
7. Select all of Column C
8. Data->More Filters->Standard Filters
9. Change the first "Field Name" to "None", click "Options" and check off "No duplications" then click "OK"

This will give you one row per album artist - album.

At this point, I copied and pasted everything to a new spreadsheet as numbers because I didn't need to do any more calculations on the original data and wanted it to remain static no matter what happened.

10. Sort by column F in descending order.
11. Delete anything below 70%

That's it.
Last Edit: June 24, 2020, 06:34:37 AM by frankz
A smile is happiness you'll find right under your nose.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8003
Nicely done, frankz.

Might I suggest you copy it and create a new thread in the Tips & Tricks section?
Download the latest MusicBee v3.5 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here.

psychoadept

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10675
Ditto phred. I immediately thought this should go in tips & tricks
MusicBee Wiki
Use & improve MusicBee's documentation!

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

frankz

  • Hero Member
  • *****
  • Posts: 3290
Well now that it's a consensus I guess I have no choice.  ;D

I don't know how helpful it would be to anyone but me (it's kind of me-specific), but I'll get it over there later today. Maybe I'll generalize it a bit more.

Thanks.  I honestly debated whether to even post this - whether it would seem relevant to anyone or any thing other than my specific situation.
A smile is happiness you'll find right under your nose.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8003
While it may seem to be frankz-specific at this moment, with tens of thousand of satisfied MB users, someone may one day have a similar question. And they'll find your post and be quite happy.
Download the latest MusicBee v3.5 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here.