-
Notifications
You must be signed in to change notification settings - Fork 72
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
Rock - Abigail C #50
base: master
Are you sure you want to change the base?
Rock - Abigail C #50
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.
Great job Abigail! You met all the learning goals. Keep up the great work (:
new_movie = {} | ||
if movie_title == None or genre == None or rating == None: | ||
new_movie = None | ||
else: |
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.
you could also rewrite to build the dictionary like so
new_move = {
"title": movie_title,
"genre": genre,
"rating": rating
}
for movie in user_data['watched']: | ||
genre = movie['genre'] | ||
genre_list.append(genre) | ||
popular_genre = max(set(genre_list), key = genre_list.count) |
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.
Hey Abigail, that is great! I'm glad you're utilizing more advanced methods and data structures. However, in the future, please add a comment that describes code that isn't covered in our curriculum.
friend_data = get_friend_titles(user_data) | ||
recommendations = [] | ||
friend_data = remove_duplicates(friend_data) | ||
for data in friend_data: | ||
if data['host'] in user_data["subscriptions"]: | ||
recommendations.append(data) | ||
return recommendations | ||
|
||
# Wave 5 | ||
def get_new_rec_by_genre(user_data): | ||
user_titles = get_user_titles(user_data) | ||
friends_titles = get_friend_titles(user_data) | ||
recommendations = [] | ||
if user_titles == []: | ||
recommendations = [] | ||
else: | ||
for title in friends_titles: | ||
if title not in user_titles: | ||
recommendations.append(title) | ||
return recommendations | ||
|
||
def get_rec_from_favorites(user_data): | ||
user_titles = get_user_titles(user_data) | ||
friends_titles = get_friend_titles(user_data) | ||
for movie in friends_titles: |
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.
great use of helper functions!
def add_to_watched(user_data, movie): | ||
user_data = { | ||
"watched":[ | ||
movie | ||
] | ||
} | ||
return user_data | ||
|
||
def add_to_watchlist(user_data, movie): | ||
user_data = { | ||
"watchlist":[ | ||
movie | ||
] | ||
} | ||
return user_data |
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.
One way to refactor this so the movie is actually being added is user_data["watched"].append(movie)
No description provided.