INTERACT FORUM

Please login or register.

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

Author Topic: Sort on album average rating  (Read 5637 times)

Humbledore

  • Galactic Citizen
  • ****
  • Posts: 272
Sort on album average rating
« on: September 19, 2013, 05:47:35 am »

Hi,
is it a way in MC to sort album on their tracks average rating?
Thanks
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Sort on album average rating
« Reply #1 on: September 19, 2013, 11:14:14 am »

You can sort the Categories by average rating.  Just select Sort > Rating from the Tab's pull down.

You can sort the contents of a pane by average rating: Customize the view, select the pane's column to be sorted from under Show Categories In This Order and press Edit.  Change the Settings > Sorting to Rating.

You cannot really sort by Average Rating in a File List, because Grouping and Sorting are one and the same and sorting is alphabetic, so if you group by Album, then the sorting is by Album (actually, Artist, Album, and Date), but if you group by Rating, then your albums will be split based on each unique track rating.
Logged
The opinions I express represent my own folly.

Humbledore

  • Galactic Citizen
  • ****
  • Posts: 272
Re: Sort on album average rating
« Reply #2 on: September 19, 2013, 02:05:11 pm »

Thanks,
But what I would like to achieve is an exact average calculation. For example, if an album has four 5 stars rated tracks and four 1 star rated tracks, the album average should become 3. Now it doesn't seem to work that way.
And it would be nice if MC then could group the albums by an average interval like 4.5-5, 4.0-4.5 and so on... :-)

 
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Sort on album average rating
« Reply #3 on: September 19, 2013, 02:23:49 pm »

You haven't indicated where you want the grouping.  By Categories in a categories view?
Logged
The opinions I express represent my own folly.

Humbledore

  • Galactic Citizen
  • ****
  • Posts: 272
Re: Sort on album average rating
« Reply #4 on: September 19, 2013, 03:57:16 pm »

Actually, it doesn't matter where the grouping is taking place. I just wonder if it's possible to accomplish an album view with sorting on average album rating, preferably grouped by some rating interval mentioned in the previous post.
Thanks!
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Sort on album average rating
« Reply #5 on: September 19, 2013, 04:55:20 pm »

Here's a panes view where the first column is sorted by Rating (its the average rating) and the second column shows the rating groups, using the display expression:

save(replace(GroupSummary(Rating), / avg,),avgrating)/
ifelse(
   Compare([avgrating], <=, 0.5), 0.0 - 0.5,
   Compare([avgrating], <=, 1.0), <0.5 - 1.0,
   Compare([avgrating], <=, 1.5), <1.0 - 1.5,
   Compare([avgrating], <=, 2.0), <1.5 - 2.0,
   Compare([avgrating], <=, 2.5), <2.0 - 2.5,
   Compare([avgrating], <=, 3.0), <2.5 - 3.0,
   Compare([avgrating], <=, 3.5), <3.0 - 3.5,
   Compare([avgrating], <=, 4.0), <3.5 - 4.0,
   Compare([avgrating], <=, 4.5), <4.0 - 4.5,
   Compare([avgrating], <=, 5.0), <4.5 - 5.0,
   1, Other
)
Logged
The opinions I express represent my own folly.

Humbledore

  • Galactic Citizen
  • ****
  • Posts: 272
Re: Sort on album average rating
« Reply #6 on: September 20, 2013, 04:33:15 am »

MrC, thank you very much! It seems to be exact what I'm looking for.  :)  I'll try your solution in a couple of days, a bad cold has attacked me. Time for rest...
Logged

Humbledore

  • Galactic Citizen
  • ****
  • Posts: 272
Re: Sort on album average rating
« Reply #7 on: September 24, 2013, 04:27:02 pm »

I noticed that your average computation doesn't reflect unassigned tracks, see attached image. Is it possible to include them as well?
And as you also can see, the same rating group repeat itself, which looks a bit clumsy. And there is only one album per group... Maybe I have missed something?
Thanks!  
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Sort on album average rating
« Reply #8 on: September 25, 2013, 02:24:08 pm »

The identical category entries seems to be a bug with how the new Expression to Group/Expression to Display category view is being handled.  I also note that sorting does not work correctly here.

Since we don't have any control over what GroupSummary() is actually doing with Rating, and it appears to ignore Unassigned values in averages, we'd have to use the global variable technique instead to calculate average ratings that include penalizing for tracks that have no ratings.  Somewhere I've posted on this, ask if you don't find it.
Logged
The opinions I express represent my own folly.

Humbledore

  • Galactic Citizen
  • ****
  • Posts: 272
Re: Sort on album average rating
« Reply #9 on: September 26, 2013, 03:45:22 am »

MrC, anyway, thank you for your efforts to improve user features! :-)  

And if any MC developer read this; if would be very nice if an albums categories thumbnails view also could be sorted on album average rating.
Thanks!
Logged

Humbledore

  • Galactic Citizen
  • ****
  • Posts: 272
Re: Sort on album average rating
« Reply #10 on: December 22, 2013, 04:01:12 pm »

Quote
Since we don't have any control over what GroupSummary() is actually doing with Rating, and it appears to ignore Unassigned values in averages, we'd have to use the global variable technique instead to calculate average ratings that include penalizing for tracks that have no ratings.  Somewhere I've posted on this, ask if you don't find it.

MrC, can you help me find your post!
Thanks!
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Sort on album average rating
« Reply #11 on: December 22, 2013, 04:52:44 pm »

I can't find the thread on first look.  It is possible that the discussion was either via email or PM.  In any case, how do you want to penalize non-rated tracks?  Should they be considered as 0 stars?
Logged
The opinions I express represent my own folly.

Humbledore

  • Galactic Citizen
  • ****
  • Posts: 272
Re: Sort on album average rating
« Reply #12 on: January 07, 2014, 04:05:10 am »

What I would prefer is a graphical thumbnails view showing the albums sorted by album rating. In my opinion non-rated tracks should NOT be penalized, because there is a big chance they just haven't been rated yet. So they should be excluded for the average calculation. (Tracks I really don't like are set to one star...)
Thanks!
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Sort on album average rating
« Reply #13 on: January 07, 2014, 12:05:13 pm »

I found the thread:

    http://yabb.jriver.com/interact/index.php?topic=72049.msg556135#msg556135

If you need me to provide the rules, let me know.
Logged
The opinions I express represent my own folly.

Humbledore

  • Galactic Citizen
  • ****
  • Posts: 272
Re: Sort on album average rating
« Reply #14 on: January 07, 2014, 12:56:18 pm »

Thanks, do you mean that this code does the trick?:

[=save(0,v_ntracks_[AAA])1]=1 [=save(0,v_duration_[AAA])1]=1 [=save(0,v_trating_[AAA])1]=1 [=ifelse(!isempty([_Rating (track)]),save(math(1 + load(v_ntracks_[AAA])), v_ntracks_[AAA]))1]=1 [=ifelse(!isempty([_Rating (track)]),save(math([duration,0] + load(v_duration_[AAA])),v_duration_[AAA]))1]=1 [=ifelse(!isempty([_Rating (track)]),save(math([_Rating (track)] * ([duration,0] / load(v_duration_[AAA]))), v_trating_[AAA]_[name]))1]=1 [=ifelse(!isempty([_Rating (track)]),save(math(load(v_trating_[AAA]_[name]) + load(v_trating_[AAA])),v_trating_[AAA]))1]=1 ~sort=[Disc #],[Track #]

I would be much grateful if you could provide me the rules so I know how to add the code into MC.

Thanks a lot!
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Sort on album average rating
« Reply #15 on: January 07, 2014, 06:09:36 pm »

That's the idea, but it does more than what you were asking.  Here is search expression to use in Set rules for file display for the view:

Code: [Select]
[=1save(0,v_ntracks_AlbumKey())]=1 [=1save(0,v_rating_AlbumKey())]=1 [=1ifelse(!isempty([Rating]),saveadd(v_ntracks_AlbumKey(), 1))]=1 [=1ifelse(!isempty([Rating]),saveadd(v_rating_AlbumKey(), [Rating]))]=1 ~sort=[Disc #],[Track #]
Here is a Panes column expression or Category expression to use:

Code: [Select]
save(math(load(v_rating_AlbumKey()) / load(v_ntracks_AlbumKey())),avgrating)/
ifelse(
   Compare([avgrating], <=, 0.5), 0.0 - 0.5,
   Compare([avgrating], <=, 1.0), <0.5 - 1.0,
   Compare([avgrating], <=, 1.5), <1.0 - 1.5,
   Compare([avgrating], <=, 2.0), <1.5 - 2.0,
   Compare([avgrating], <=, 2.5), <2.0 - 2.5,
   Compare([avgrating], <=, 3.0), <2.5 - 3.0,
   Compare([avgrating], <=, 3.5), <3.0 - 3.5,
   Compare([avgrating], <=, 4.0), <3.5 - 4.0,
   Compare([avgrating], <=, 4.5), <4.0 - 4.5,
   Compare([avgrating], <=, 5.0), <4.5 - 5.0,
   1, Other
)

The number of tracks per album is stored in the global variable v_ntracks_AlbumKey() and the cumulative rating for the album is stored in v_rating_AlbumKey().  The math() expression does the averaging:

   math(load(v_rating_AlbumKey()) / load(v_ntracks_AlbumKey()))
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up