INTERACT FORUM

Please login or register.

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

Author Topic: JQL: Filter artist by criteria first, then list all tracks for those  (Read 1539 times)

Rubberduck0

  • Junior Woodchuck
  • **
  • Posts: 75

What looked like a simple question at first, is still unsolvable for me after many of hours:
-------------------------------------------------------------------------------------------------------------------------
I want to have a library view, which takes all artists with songs rated 4+ (artist should also be the first category in the view).
But it shows all tracks of those artists, not only the 4+ rated ones.
-------------------------------------------------------------------------------------------------------------------------
As I understand it MC is file based and all expressions and functions are run on a per file basis. Therefore there is no standard funtion which could do that above. This took me a while to understand. Then I thought maybe this could be solved with variables and I came a little closer to the goal, but only a little. With SAVE and SAVEADD I got the list of artists more or less, but of course the same artist was listed multiple times, as it was added every time the criteria were fulfilled. The I tried to use CLEANLIST to remove duplicates. But this did not work. Then I ran our of ideas....

Here is a simplified example, where the list is created not by criteria but by assigning two artists to the list (actually 'U2' is added many thousand times, once for each track in the library, but this simulates the issue above):
Code: [Select]
[=save(Pink Floyd,artlist)1]=1
[=saveadd(artlist,U2,1)1]=1
[Artist]=ListClean([artlist],1)

Can anyone help me with this? I should add that the performance of this code is also pretty bad. So, maybe there is a much simplier solution for this?
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: JQL: Filter artist by criteria first, then list all tracks for those
« Reply #1 on: July 26, 2015, 07:51:47 pm »

This is actually pretty easy to do.  Let me be sure I understand what you want:

1.  Select Artists that have any song at 4 stars or above.
2.  Expand each of these artists to show all of their songs, no matter what the rating.

If that's it, here's an expression to do exactly that.  You can cut and paste this into the "set rules for file display" area by using the Import/Export button.

Code: [Select]
[Rating]=>=4 ~sort=[Artist],[Album Artist (auto)],[Album],[Disc #],[Track #],[Name] ~expand=artist
The sort is there because I took this from a clone of an Artists view.  You can change the sort and not affect the rest of it I believe.  Give it a try and see if it does what you want.

Brian.
Logged

Rubberduck0

  • Junior Woodchuck
  • **
  • Posts: 75
Re: JQL: Filter artist by criteria first, then list all tracks for those
« Reply #2 on: July 27, 2015, 05:23:30 pm »

Shame on me!!!  :-[
"expand" is doing the magic.
Thanks a lot, works perfectly! :)
CLOSED!
Logged
Pages: [1]   Go Up