Author Topic: Sorting by year not working correctly on Album covers view  (Read 2738 times)

blackwood

  • Jr. Member
  • **
  • Posts: 34
I' m grouping and sorting by year, but the sorting ignores the month and day...

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2470
The Year tag does what it says on the tin, so even if you have a full date value in that tag it won't be displayed.
Create a virtual tag that formats the date the way you want, and group by that instead.
e.g.

Code
$Date(<Year>,d MMM yyyy)

-edit-
Sorry, half way through reading and replying I forgot you were trying to sort by the full date value, not display it.
So this answer isn't very helpful.
Last Edit: August 27, 2020, 07:23:12 AM by Zak
Bee excellent to each other...

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34408
I think sorting by the Year tag should use the full date entered into the Year tag, as long as its a valid date that is correctly formatted
If you are using Year(yyyy) then only the year part of the date is used

blackwood

  • Jr. Member
  • **
  • Posts: 34
I think sorting by the Year tag should use the full date entered into the Year tag, as long as its a valid date that is correctly formatted
If you are using Year(yyyy) then only the year part of the date is used


yes it works like you say except when i start grouping by year

blackwood

  • Jr. Member
  • **
  • Posts: 34
The Year tag does what it says on the tin, so even if you have a full date value in that tag it won't be displayed.
Create a virtual tag that formats the date the way you want, and group by that instead.
e.g.

Code
$Date(<Year>,d MMM yyyy)

thank you this helped but the actual code was this $Date(<Year>,yyyy MM dd)

I'm now facing another problem, I can't seem to be able to change the grouping order (year) from ascending to descending..

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3840
  • MB Version: 3.6.8878 P
I'm now facing another problem, I can't seem to be able to change the grouping order (year) from ascending to descending..
Grouping order sorting is only alpha-numeric.
That is, it only sorts ascending.
MusicBee and my library - Making bee-utiful music together

blackwood

  • Jr. Member
  • **
  • Posts: 34
my first screen doesn't show everything but my albums were grouped by year descending...

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3840
  • MB Version: 3.6.8878 P
If your first 'Sort By' selection item and 'Group By' selection match, then you can use the "Sort Ascending' or 'Sort Descending' options at the bottom of the first 'Sort By' right-click option.

This worked in your OP as you were sorting and grouping by 'Year'.

It might work with 'Year' and your virtual tag as they're both dates, but I've not tested that.
MusicBee and my library - Making bee-utiful music together

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2470
I'm now facing another problem, I can't seem to be able to change the grouping order (year) from ascending to descending..
Grouping order sorting is only alpha-numeric.
That is, it only sorts ascending.

Testing this now, this isn't strictly true.

If your first 'Sort By' selection item and 'Group By' selection match, then you can use the "Sort Ascending' or 'Sort Descending' options at the bottom of the first 'Sort By' right-click option.

This isn't always true either.  :-\


I've just spent over an hour looking at this and I can't find any way to explain how sorting is applied to groups and albums.  :(

Some examples:
Group by: Artist - Sort by: Artist / Album
Group by: Genre - Sort by: Genre / Album
Group by: Decade - Sort by: Year / Album

Sort by ascending/descending: Affects order of groups, then albums.

Suggests the sorting of all albums is done first, then split into groups as the first sort tag changes.

Group by: Artist - Sort by: Year / Album
Group by: Decade - Sort by: Decade / Year

Sort by ascending/descending: Affects order of albums only, groups are always ascending.

Suggests the grouping is applied first, then sorting is done within each group.


If I had to guess, I'd say it's a combination of things like whether the grouping tag is alphabetic or numeric; whether the tag is a string, number or date; whether the sort tag matches the grouping tag; with some extra sorting hard-coded in for some common tags like Artist.

Then you also have to consider that custom sorting sets have their own sort order for each tag, and how the Sort Ascending / Descending options on the menu should affect those, if at all.
Last Edit: August 26, 2020, 04:09:17 PM by Zak
Bee excellent to each other...

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2470
OP, it looks you can achieve the ordering you want with the following:
Group by: Year (yyyy)
Sort by: Year (yyyy) / Year / Album
Sort Descending
where this a custom sorting set (via Define Custom Sorting...).
Change the ascending/descending order of the second Year tag in that set to order the albums within the year group, noting that it works opposite to what is specified.

Duplicating the year tag in the sorting seems to be what makes it work.

Note that the built-in Year tag works for this, so you can reclaim that formatted virtual tag from earlier.


I think sorting by the Year tag should use the full date entered into the Year tag, as long as its a valid date that is correctly formatted
If you are using Year(yyyy) then only the year part of the date is used

Steven, it looks look date sorting doesn't work correctly within a group.
Group by: Year - Sort by: Year / Album
This only sorts by album within each year group.
Bee excellent to each other...

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3840
  • MB Version: 3.6.8878 P
Testing this now, this isn't strictly true.
Thanks for testing this Zak.
I thought it might have something to do with string, number or date definition, but I didn't have time to check it out properly last night.
MusicBee and my library - Making bee-utiful music together

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34408
When grouped by Year then MB uses Year(yyyy) as the primary sort so the grouping works correctly, and removes the sorting by the actual Year tag as an optimisation.
I will change it to leave in the sorting by the year tag in so it would work as expected

edit:
if you are using v3.3
https://getmusicbee.com/patches/MusicBee33_Patched.zip
unzip and replace the existing musicbee application files

v3.4 patch version is also updated
Last Edit: August 27, 2020, 10:25:13 AM by Steven