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

MBS-13416: Link to entity pages from LB buttons #3418

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

reosarevok
Copy link
Member

Implement MBS-13416

Problem

We now have entity pages for artists and RGs ("albums") in ListenBrainz, but we still link only to BrainzPlayer playlists.

Solution

This changes the LB buttons to link to entity pages when possible.

Release links redirect to release groups, so the LB team advised to just link to RGs directly. Since the pages cannot be played if empty, we don't change the existing behaviour where we hide the buttons if no releases exist in an RG
or no tracks exist on a release. We no longer care about the first release's MBID for RGs, just that it exists, so this simplifies that parameter to be boolean.

Also adding links for artists since those are now available. I did not skip "empty" artists (with no releases nor recordings) because we only have this data from the artist index but we want the buttons to appear on all tabs, and it doesn't seem worth passing a boolean up from the Perl layer just for this.

Recording pages do not yet exist, so we keep linking to the player for recordings (and recording collections). Since recordings are the only case where an array of MBIDs is actually supported, I changed the code to just return nothing when passed an array in any other case.

Testing

Manually, with sample data, particularly /artist/ae0b2424-d4c5-4c54-82ac-fe3be5453270 and /release-group/863ca853-cc83-47dd-8106-1284399c44f5

@reosarevok reosarevok added the QoL Non-urgent quality of life improvements label Nov 26, 2024
Release links redirect to release groups, so the LB team advised to
just link to RGs directly.
Since the pages cannot be played if empty, we don't change the existing
behaviour where we hide the
buttons if no releases exist in an RG
or no tracks exist on a release.
We no longer care about the first release's MBID for RGs, just that it
exists, so this simplifies that parameter
to be boolean.

Also adding links for artists since those are now available. I did not
skip "empty" artists (with no releases nor recordings) because
we only have this data from the artist index but we want the buttons
to appear on all tabs, and it doesn't seem worth passing a boolean up
from the Perl layer just for this.

Recording pages do not yet exist, so we keep linking to the player
for recordings (and recording collections). Since recordings are
the only case where an array of MBIDs is actually supported,
I changed the code to just return nothing when passed an array
in any other case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QoL Non-urgent quality of life improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants