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

Add user track favorites #886

Merged
merged 3 commits into from
Oct 6, 2020
Merged

Add user track favorites #886

merged 3 commits into from
Oct 6, 2020

Conversation

jowlee
Copy link
Contributor

@jowlee jowlee commented Oct 5, 2020

Trello Card Link

https://trello.com/c/A7BOsv5J/1476-port-the-new-api-into-the-dapp

Description

Adds the user track favorite endpoint so that the client does not need to make multiple requests for this information.

Note: the change to the file discovery-provider/src/queries/get_savers_for_playlist.py fixes a bug I introduced #875

Services

Discovery Provider

Does it touch a critical flow like Discovery indexing, Creator Node track upload, Creator Node gateway, or Creator Node file system?

Delete an option.

  • ✅ Nope

How Has This Been Tested?

I ran it locally against the Prod snapshot db

Track.is_current == True,
Save.user_id == user_id,
Save.is_current == True,
Save.is_delete == False,
Copy link
Member

Choose a reason for hiding this comment

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

Remove is_delete here since you optionally add later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The is_delete later is a filter for if it should return deleted tracks that are favorited. If the is_delete on the Save table is true, it mean the user undid the save action, so the track is not saved.

from src.queries.query_helpers import add_query_pagination, populate_track_metadata, \
get_users_by_id, get_users_ids

def get_full_save_tracks(args):
Copy link
Member

Choose a reason for hiding this comment

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

I think we should just call this get_save_tracks or something like that. The "full" vs. "not full" thing is not really part of the query layer so far

@jowlee jowlee merged commit bcab5a5 into master Oct 6, 2020
@jowlee jowlee deleted the jowlee-user-track-favorites branch October 6, 2020 14:00
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.

None yet

2 participants