INTERACT FORUM

Please login or register.

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

Author Topic: Need help with Expression to display the number of Albums in tree (Solved )  (Read 1819 times)

HTPC Videophile

  • World Citizen
  • ***
  • Posts: 110

Below is the Standard view of my library. The field on the extreme left "Album" is filled using the option :Fill properties from filename . Just as the bottom of the screen shows the total number of files : 7448 files(15.7days-5.5TB), can i customize that to also include the unique count of Albums in this format : 7448  files, N Albums(15.7 days-5.5TB)  ?

Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2591
Re: Need help with Expression
« Reply #1 on: November 16, 2022, 10:20:16 am »

No, that label is not customizable (you can only customize what shows up when one of the files is selected).
You can however add the number of Albums to the Tree label so that it reads "Dance&Song (34)" for instance.

Assuming that's the [Genre], you can edit your Songs view like this:
Type: Expression
Name: Genres
Expression to Group by: [Genre]
Expression to Display: [Genre] <font color="#8080FF">(groupcount(Album) albums)
Logged

HTPC Videophile

  • World Citizen
  • ***
  • Posts: 110
Re: Need help with Expression
« Reply #2 on: November 17, 2022, 12:51:10 am »

No, that label is not customizable (you can only customize what shows up when one of the files is selected).
You can however add the number of Albums to the Tree label so that it reads "Dance&Song (34)" for instance.

Assuming that's the [Genre], you can edit your Songs view like this:
Type: Expression
Name: Genres
Expression to Group by: [Genre]
Expression to Display: [Genre] <font color="#8080FF">(groupcount(Album) albums)

 How do i do so ? Right clicking on Blu-ray.Dance&Song on the tree in the left pane leads me to this with Set Rules for display option. How do i set the expression suggested by you from there to get the Album Count ? (Appologize for not being able to understand your instructions. Tried wiki but couldn't get anywhere further)
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2591
Re: Need help with Expression
« Reply #3 on: November 17, 2022, 03:40:19 am »

The options show up when you cllck on "Add..." button - not sure why it's grayed out for you. Try doing it on the "Songs" view, or create a new view for testing.
Logged

HTPC Videophile

  • World Citizen
  • ***
  • Posts: 110
Re: Need help with Expression
« Reply #4 on: November 17, 2022, 04:47:16 am »

The options show up when you cllck on "Add..." button - not sure why it's grayed out for you. Try doing it on the "Songs" view, or create a new view for testing.

Thanks @zybex .Finally i got what i was looking for. Now the left pane shows a new label called "All Albums(1347)" beneath the category "Blu-ray.Dance&Song" showing the count of Blu-rays/Albums from which the songs have been ripped. Just need a bit of refinement  so that  the new extra label  "All Albums" is not there and i get the display as Blu-ray.Dance&Song(1347).Its so funny that despite using the software since 2014 and and having personally  introduced and initiated to so many friends n relatives , I am myself unaware of so many of existing features.[BTW Jim's team is at fault for having tucked in so many capabilities under one roof of JRiver  :P]
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2591
Re: Need help with Expression
« Reply #5 on: November 17, 2022, 05:53:33 am »

What field is this "Blu-ray.Dance&Song" coming from? Or is it a name you entered manually?
Logged

HTPC Videophile

  • World Citizen
  • ***
  • Posts: 110
Re: Need help with Expression
« Reply #6 on: November 17, 2022, 06:00:47 am »

What field is this "Blu-ray.Dance&Song" coming from? Or is it a name you entered manually?
Ya, its a manually entered name with file-type rule set to .m2ts to group all blu-ray songs(1080p  and UHD blu-rays) together. Similary for Pro-resolution songs label  i use the file rule to include  .mov files.(For consistency and ease in grouping, i rip all blu-ray songs  in m2ts only , ProResolution songs in  .mov and so on for different categories)
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2591
Re: Need help with Expression
« Reply #7 on: November 17, 2022, 07:14:07 am »

OK, try this on your "Songs" view (or create a new one) - this should create a view with sub-categories for each File Type. The trick is the expression to display the filetype as whatever name you want:

- Add a category:
Type: Expression
Name: Types (or whatever)
Expression to group by: [File Type]
Expression to Display: FirstNotEmpty(ifcase([File Type], 1, m2ts, Blu-ray Dance&Song, mov, ProResolution Dance&Song, mkv, WhateverYouLike), [File Type]) (groupcount(Album))

- Add a second category:
Type: Library Field
Field: Album (or "Artist - Album (year)")

Click OK. You can then change the View grouping to "Album" and sort as you like. No need to set "rules for file display".
The expression above can be changed to add the names for more filetypes.

Breaking down the View by FileType works, but is not ideal. Maybe you should consider using another field (or adding a new one) to tag all your files with the group name they belong. Then you can use that in the Views without any expression.
Logged

HTPC Videophile

  • World Citizen
  • ***
  • Posts: 110
Re: Need help with Expression
« Reply #8 on: November 17, 2022, 11:59:08 pm »

@zybex, thanks a lot for your help. Finally achieved the desired results. Now the info regarding the number of blu-rays/Albums is just as i wanted it to be  :)
Logged

HTPC Videophile

  • World Citizen
  • ***
  • Posts: 110
Re: Need help with Expression to display the number of Albums in tree
« Reply #9 on: December 10, 2022, 03:30:45 am »

@Zybex , Is there a way to display the number of items in each album in the left tree .For example in the pic below, i would like A.Gorgeous.Girl.Like.Me( 4 Songs) in the left tree in the manner it is being displayed for the Blu-ray Dance/Song(1356 Albums, 7565 Songs).
Currently i'm using the expression provided by you  as shown in the second pic below. What else do i need to get the per album count display ?
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2591
Re: Need help with Expression to display the number of Albums in tree
« Reply #10 on: December 10, 2022, 04:30:53 am »

Just edit the "Album" category and change it to "Expression" type with:
Name = Albums
Group by = [Album]
Display = [Album] /(groupcount() songs/)

or add some color:
Display = [Album] <font color="#8080FF">/(groupcount() songs/)

Just curious, why do you have dots instead of spaces all over the place? Reminds me of my old dayz.
Logged

HTPC Videophile

  • World Citizen
  • ***
  • Posts: 110
Re: Need help with Expression to display the number of Albums in tree
« Reply #11 on: December 10, 2022, 04:46:10 am »

Wow  :) :) Thanks for the expression. Here is the final view of my library(And i simply can't thank enough to  @Zybex for his help. You are the distinguished Professor of Library Expression Language :) ).
Logged

HTPC Videophile

  • World Citizen
  • ***
  • Posts: 110
Re: Need help with Expression to display the number of Albums in tree
« Reply #12 on: December 10, 2022, 04:51:19 am »

Just curious, why do you have dots instead of spaces all over the place? Reminds me of my old dayz.

Just a standard Naming convention for files followed by me. Earlier it helped me in using simpler perl scripts while doing some file management tasks in linux :)
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2591
Re: Need help with Expression to display the number of Albums in tree (Solved )
« Reply #13 on: December 10, 2022, 06:36:26 am »

That's fine, but the names and tags in MC don't have to keep the dots. Album/track names and such can be whatever you like regardless of the actual folder and filenames.
Logged
Pages: [1]   Go Up