-
Notifications
You must be signed in to change notification settings - Fork 81
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
Sapphire - Monica Lagdaan #71
base: main
Are you sure you want to change the base?
Conversation
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.
Hi Monica! I know that we've worked on 4+ months of content since this project was originally assigned, so a lot of context has changed.
Anyway, great work on this project! Your code looks great. In particular, your get_new_rec_by_genre
and get_rec_from_favorites
implementations for the final Wave 5 are really great. I really like what your code style has developed into, because your logic is clear and efficient.
Well done! LGTM!!!
# Assert | ||
assert len(updated_data["watchlist"]) == 1 | ||
assert len(updated_data["watched"]) == 2 | ||
assert HORROR_1 == updated_data["watched"][1]["title"] |
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.
assert HORROR_1 == updated_data["watched"][1]["title"] | |
assert HORROR_1["title"] == updated_data["watched"][1]["title"] |
After looking at the definition of HORROR_1
in tests/test_constants.py
, I realized that this change passes the tests!
watchlist = user_data.get("watchlist", []) | ||
watched = user_data.get("watched", []) |
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.
I like this pattern, I would keep doing this when it makes sense!
if movie["title"] == title: | ||
found_movie = movie | ||
watchlist.remove(movie) | ||
watched.append(movie) |
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.
Nitpick: I like how this reads since watched = user_data.get("watched", [])
etc, but this is also a good opportunity to use the previous functions:
watched.append(movie) | |
add_to_watched(user_data, movie) |
|
||
user_watched = set([movie["title"] for movie in user_data["watched"]]) | ||
friends_list = [] | ||
|
||
for friend in user_data["friends"]: | ||
for movie in friend["watched"]: | ||
if movie["title"] not in user_watched and movie not in friends_list: | ||
friends_list.append(movie) | ||
|
||
return friends_list |
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 probably one of the best implementations/directions to go with this function, your code looks clean and robust, well done!
No description provided.