Skip to content

LB-1508 Allow hiding personal recommendations #2808

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

1 change: 1 addition & 0 deletions frontend/js/src/user-feed/UserFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ export default class UserFeedPage extends React.Component<
}
if (
(event.event_type === EventType.RECORDING_PIN ||
event.event_type === EventType.PERSONAL_RECORDING_RECOMMENDATION ||
event.event_type === EventType.RECORDING_RECOMMENDATION) &&
event.user_name !== currentUser.name
) {
Expand Down
4 changes: 3 additions & 1 deletion listenbrainz/webserver/views/user_timeline_event_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,9 @@ def hide_user_timeline_event(user_name):
raise APIBadRequest("JSON document must contain both event_type and event_id", data)

row_id = data["event_id"]
if data["event_type"] == UserTimelineEventType.RECORDING_RECOMMENDATION.value:
event_type = data["event_type"]
if event_type in [
UserTimelineEventType.RECORDING_RECOMMENDATION.value, UserTimelineEventType.PERSONAL_RECORDING_RECOMMENDATION.value]:
result = db_user_timeline_event.get_user_timeline_event_by_id(db_conn, row_id)
elif data["event_type"] == UserTimelineEventType.RECORDING_PIN.value:
result = get_pin_by_id(db_conn, row_id)
Expand Down