Skip to content

Fix[LB-1785]: Impersonaly recommend#3620

Open
Swaim-Sahay wants to merge 1 commit intometabrainz:masterfrom
Swaim-Sahay:Impersonaly-recommend
Open

Fix[LB-1785]: Impersonaly recommend#3620
Swaim-Sahay wants to merge 1 commit intometabrainz:masterfrom
Swaim-Sahay:Impersonaly-recommend

Conversation

@Swaim-Sahay
Copy link
Copy Markdown

Description

This PR adds "Entity Recommendations" allowing users to recommend MusicBrainz entities (artists, releases, release groups, recordings) to each other via API. Recommendations are ranked by an auto computed specificity score and rate limited to 10/day.

Ticket: LB-1785

Problem

Users had no way to create personal entity to entity recommendations within ListenBrainz.

Solution

Added a new recommendation.entity_recommendation table and three API endpoints for adding, removing, and retrieving recommendations, with validation, auth, upsert support, and pagination.

Changes Made

  1. admin/sql/: New entity_recommendation table, enum type, indexes, keys, and migration script.
  2. listenbrainz/db/entity_recommendation.py: DB layer -> insert , delete, get (paginated), rate limit check, specificity score computation.
  3. listenbrainz/webserver/views/entity_recommendation_api.py: API endpoints — GET /1/user//entity-recommendations, POST /1/entity-recommendation/add, POST /1/entity-recommendation/remove.
  4. listenbrainz/webserver/init.py: Registered the new blueprint.

AI Usage

  • Received assistance with boilerplate for backend endpoints and integration test structure.
  • All code has been thoroughly reviewed, manually tested and fully understood prior to submission.

- Create recommendation.entity_recommendation table with SQL schema
- Add foreign keys, indexes, primary keys, and custom types
- Implement DB layer (listenbrainz/db/entity_recommendation.py)
- Add API endpoints for adding, removing, and retrieving recommendations
- Register entity_recommendation blueprint in webserver
@MonkeyDo
Copy link
Copy Markdown
Member

MonkeyDo commented Mar 9, 2026

Hi, I think this is the type of new feature that you should consult maintainers about, to ensure you are heading in the right direction first before producing code.

This is currently only a partial feature. How do you want to surface it on the website and what is the UX going to look like?
How is the data used and presented to users?

@MonkeyDo
Copy link
Copy Markdown
Member

I will also add, if you are looking for something to work on, please look at your older unfinished PRs rather than opening whole new ones.

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