Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LB-1626: Sort Release Groups on Artist Page #2985

Merged
merged 11 commits into from
Oct 10, 2024
Merged

Conversation

anshg1214
Copy link
Member

@anshg1214 anshg1214 commented Sep 23, 2024

This PR fixes LB-1626.

But now since we're displaying more release group types, we need to fix LB-1536 on priority.

Since we're sorting the release groups in the frontend, so sorting the release groups in the backend is not required.
@anshg1214 anshg1214 changed the title Sort Release Groups on Artist Page LB-1626: Sort Release Groups on Artist Page Sep 25, 2024
Copy link
Member

@MonkeyDo MonkeyDo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can tell after deployment on test.LB, the sorting isn't working well yet.
I think we have made some assumptions a bit too fast, and maybe we are doing some operations in the wrong order.
I'll take this complex page as an example (lot of different types):
https://test.listenbrainz.org/artist/f58384a4-2ad2-4f24-89c5-c7b74ae1cce7/

If you look at the albums and compare to the MB page, there are only a handful of items there and they are not the albums I would expect to see (there are some demos, compilations, and about 20 albums missing)
I think the main issue is doing the groupBy operation after the sortBy. We should group first and apply the sort to each group.

Thanks to the react query devtools I can get the original server to try some things:

Sort by primary type and by first secondary type:
_.groupBy(releaseGroups, rg => rg.type + (rg.secondary_types?.[0] ? " + " + rg.secondary_types?.[0] : ""))
We end up with something close to what MB displays:
image
Applying the sortBy (as you coded it in this PR) for each of these groups gives me the expected result.

If we don't want to show all these different sections, we can probably show primary-type-only section followed by a group composed of that same primary type + all other secondary types.
For example based on the screenshot of groups above:

  • Group 1: Album
  • Group 2: Album+Live, Album+Compilation,Album+Demo,Album+Remix
  • Group 3: Single
  • Group 4: Single+Live (Single+Anything would go here too)
  • Group 5: EP
  • Group 6: EP+Live (EP+Anything would go here too)
  • etc.

For this, something along those lines should work:
_.groupBy(releaseGroups, rg => rg.type + (rg.secondary_types?.length ? "+" : ""))
image

More likely than not, we probably want to select specific secondary types to show separate, and clump some other ones together.
For example, I think 1. Album, 2. Album+Live, and 3. (Album+Compilation, Album+Demo,Album+Remix) could be a good way to split it, i.e. keep live albums separate but clump the rest together.
Let me know if you want to have a chat about this in more details

Copy link
Member

@MonkeyDo MonkeyDo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saw a couple more details

frontend/js/src/artist/ArtistPage.tsx Outdated Show resolved Hide resolved
frontend/js/src/artist/ArtistPage.tsx Outdated Show resolved Hide resolved
@anshg1214
Copy link
Member Author

@MonkeyDo I've made the respective changes to show all the primary types and secondary types similar to how MusicBrainz shows

This PR is live on https://test.listenbrainz.org/

Copy link
Member

@MonkeyDo MonkeyDo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's looking a hundred times better after the last pass !

I agree with your decision to follow the MB way, as we quite clearly don't knnow enough between the two of us to account for all the weird ways items can be split or combined depending on type, nor have a clear idea of what our users would want to see.
At least with type + secondary type it is clear!

Final couple of changes and I think this is ready.

frontend/js/src/artist/ArtistPage.tsx Outdated Show resolved Hide resolved
frontend/js/src/artist/ArtistPage.tsx Show resolved Hide resolved
Copy link
Member

@MonkeyDo MonkeyDo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking mighty fine to me !

@MonkeyDo
Copy link
Member

MonkeyDo commented Oct 10, 2024

After merging this I have the follow-up PR #2997 lined up that will use the HorizontalScroll component from #2995 to the artist page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants