INTERACT FORUM

Please login or register.

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

Author Topic: Help with Expressions  (Read 376 times)

AlreadyFree

  • Junior Woodchuck
  • **
  • Posts: 54
Help with Expressions
« on: February 10, 2024, 01:22:48 am »

I'm trying to set up a custom view that goes Artist-->Grouping-->Album, where Grouping is Complete Albums, Complete Singles, Live Albums, Bootleg Albums, etc. Is there any way to set up an expression or something so that if there only exists one grouping for an artist then it'll bypass the grouping section for that artist and go straight to the album section for the single grouping category that that artist has?

I'm also trying to figure out how I got it set up so that when I open up Complete EP's grouping it automatically opens the Tracks window on the Albums tab but it doesn't do that for any other grouping category and can't find a setting for it anywhere except for a setting for the entire view to "always show files". But I don't want to do that because I don't want it to show tracks automatically on the Artist tab or the Grouping tab but only on the Album tab.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2453
Re: Help with Expressions
« Reply #1 on: February 11, 2024, 05:55:58 am »

This is possible with fieldQuery(), but it makes the view so slow as to be unusable if you have more than 100 albums or so.
You would need something like this: (Warning - this will freeze your MC while calculating)
1st level - group by Artist
2nd level - group by Expression:
Code: [Select]
if(isEqual(Listcount(fieldQuery(Artist, treenode(1), AlbumGroup, 0, 0)),1, 2), [Album] ([AlbumGroup]), [AlbumGroup]\[Album])&DataType=[list]
No 3rd level needed. [AlbumGroup] is the name of the field containing your Grouping tag (complete/single/live/bootleg).

I guess ZStats could be used to store the pre-calculated FieldQuery() values.

Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2453
Re: Help with Expressions
« Reply #2 on: February 11, 2024, 06:16:39 am »

This could perhaps be an interesting new feature:

Feature request: add option on Views to "suppress solitary nodes"
Logged
Pages: [1]   Go Up