Author Topic: Favorite artists query  (Read 2891 times)

whoozwah

  • Jr. Member
  • **
  • Posts: 22
I'm looking for a way to generate a list of favorite artists and I haven't been able to do it thus far. What I want is a list of album artists wherein the # of tracks I have rated as Loved by them exceeds 5. I couldn't find a way to do this with auto playlists and I don't understand how the library reporting tools work to know if I could achieve it via that method. Can anyone help?

EDIT: I was thinking about this more and I think I have an idea what will do it but I don't know how to actually do it.

1. create a custom tag "AA Love Count"
2. Run an auto library report that grabs the total tracks that I've loved by an Album artist and write that number to the tag. (can you apply this tag to all tracks across your whole library? I really need some sort of super ELI5 tutorial about how the library reports work)
3. create an auto playlist that uses my Loved tracks playlist as the source that says "match all tracks where AA Love Count exceeds 5"

If someone can walk me through the actual process for doing that I'd be grateful.
Last Edit: December 04, 2019, 09:27:26 PM by whoozwah

boroda

  • Hero Member
  • *****
  • Posts: 4744
create virtual tag, which displays 0 for not loved tracks and 1 for loved ones.
add 'album artist' or 'artist' grouping field to alr command, then add 'sum(your virtual tag)' aggregated function to alr.
save preset and assign virtual tag function id to this preset.
create another virtual tag with content: $ALR(<URL>,your function id)
create auto-playlist as you already suggested or just add 2nd virtual tag to main view and sort track list by this tag.

whoozwah

  • Jr. Member
  • **
  • Posts: 22
That got it. For some reason the $ALR virtual tag I used to create the playlist didn't allow me to use greater than or less than symbols to run the search. I had to search around for regex on the internet to match any number greater than 5. That was difficult as I don't understand regex.

Also, How do you add a leading zero to the $ALR(<URL>,my function id)
Last Edit: December 06, 2019, 04:59:50 AM by whoozwah

boroda

  • Hero Member
  • *****
  • Posts: 4744
Also, How do you add a leading zero to the $ALR(<URL>,my function id)
why do you need leading zeros? this virtual tag is not for decoration, it's for sorting.

whoozwah

  • Jr. Member
  • **
  • Posts: 22
The leading zeroes are not for decoration. They are for sorting. The values in the final tag I'm using are in the triple digits and the numbering is wrong. Leading zeroes should ensure that natural numbering is restored.

As it is now, it sorts 100s, 10s, 20s, 30s etc instead of coming after 90s. I hope that clarifies my problem.

boroda

  • Hero Member
  • *****
  • Posts: 4744
it's possible to add leading zeros, but there is a better way to solve the sorting issue: go to edit> edit preferences> tags(2)> 'configure fields...' button, assign type to your virtual tag as 'number'.

whoozwah

  • Jr. Member
  • **
  • Posts: 22
Right on. I'll give that a try when I get home from work. I appreciate your help. I've never used the virtual tags or library reports before so I'm learning a lot more about the more powerful features of musicbee. It's neat.  :)

whoozwah

  • Jr. Member
  • **
  • Posts: 22
Just wanted to say thanks, @boroda. defining the field type as number worked. I appreciate the help :)

ninjaman81

  • Jr. Member
  • **
  • Posts: 20
I came across this post as I'm looking to do the exact same thing. Been using MusicBee for a few weeks now. LOVE IT!

I can't seem to figure out how to do step 1 of what @boroda calls out.

I created a virtual tag and put the following in the formula: $If(<Love>="Loved",0,1)

It returns the value 1 regardless if the song is loved or not. Something is just not working. I replaced "1" with <love> so that I can see what it's outputting, it outputs correctly. It shows "Loved" on songs I loved and "Not Loved" on songs that are not loved. So why does this formula ($If(<Love>="Loved",0,1)) not work. I have tried without quotes, I have tried comparing <love> to binary values. Nothing is working as I would except.

Can someone please tell me what's wrong with my formula. Thanks!

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1139
  • Heal The World
It returns the value 1 regardless if the song is loved or not.
I haven't gone through the whole thread, but try $If(<Love>="L",0,1)
The source code to any of my contributions is available on the same download link as the add-ons

ninjaman81

  • Jr. Member
  • **
  • Posts: 20
Okay, by pure luck, I realized that the value stored in that tag was "L" when tracks were loved.

So the correct syntax is: $If(<Love>="L",1,0)

Kind of crazy, since when I use the <love> tag in the true or false outputs, it displays "Loved" or "Not Loved", yet the value in the tag was "L". I don't get it, but it's working now.

However, now I'm stuck with the subsequent steps. I couldn't understand the steps clearly, but the below screenshots show how I configured it. I think I followed the directions. But the Virtual2 tag has no values when I add to the main view on track view.






ninjaman81

  • Jr. Member
  • **
  • Posts: 20
Thank you Mayibongwe. I was just posting that.

My screenshots didn't post. Let me try posting them again here:



Last Edit: November 16, 2023, 06:23:08 AM by ninjaman81

ninjaman81

  • Jr. Member
  • **
  • Posts: 20
Also, I don't know if it's related, but when I click on the "Preview" button when I have the above preset selected, it scans the library and then pops up with the below error message. After I close the error pop up, MusicBee crashes/closes.

MusicBee v3.5.8447.35843Store (Win10.0), 15 Nov 2023 22:23:

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at MusicBeePlugin.LibraryReportsCommand.applyPresetResults(String[] queriedFiles, Boolean interactive, Boolean saveResultsToTags, String functionId, Int32 sequenceNumberGrouping, Nullable`1 filterResults)
   at MusicBeePlugin.LibraryReportsCommand.executePreset(String[] queriedFiles, Boolean interactive, Boolean saveResultsToTags, String functionId, Nullable`1 filterResults)
   at MusicBeePlugin.LibraryReportsCommand.previewTrackList()
   at MusicBeePlugin.PluginWindowTemplate.serializedOperation()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Bee-liever

  • Member
  • Hero Member
  • *****
  • Posts: 3840
  • MB Version: 3.6.8878 P
@ninjaman81
with the new library reports the 2nd virtual tag should now be:
$LR(<URL>,121)
MusicBee and my library - Making bee-utiful music together

ninjaman81

  • Jr. Member
  • **
  • Posts: 20
Thanks Bee-liever. Well, now it shows ??? in that field when I display it. It shows ??? for all tracks for that virtual2 field.

I still think there is some issue with how the library report is configured. I have never configured anything with this Library report before, so I have no idea what I'm doing.

From what you see in the screen shot is that correct? Do I need to do something to have it run that report? When I click the preview button, it looks like it's scanning my entire library and then it crashes (which is what I included above).