-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Add pin events to user timeline (backend) #1559
Conversation
This function a list of PinnedRecordings for a list of users in descending order of their created date. this will be used to converted to timeline events to render pin events on user feeds
events = [] | ||
for pin in recording_pin_events_db: | ||
try: | ||
pin = fetch_track_metadata_for_pin(pin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of a problem here -- given that the fetch_track_metadata_for_pin is in a loop, it means that we're going to do 1 DB query for each pin event, which is far from ideal. We need to support doing this in one query -- one possibility is to refactor the fetch_track_metadata_for_pin to accept a list of pins, rather than just one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, 1570 is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the merge conflict on 1560 and lets get this merged!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good overall, we just need to refactor that one (two?) function(s).
This reverts commit 2b2350f.
(this PR doesn't depend on any currently opened PR's and can be merged)
This PR contains the backend changes to add pin events to the user timeline.
Changes:
frontend changes -> #1560