AmirShabani commited on
Commit
474d0e7
1 Parent(s): 308787f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -110,21 +110,21 @@ def display_movie(movie, rating):
110
  user_input[f"{data['title']} ({data['year']})"] = rating
111
  poster = get_poster(data['title'])
112
 
113
- if len(user_input) == 5:
114
- # Get the recommended movies from the input
115
- r_movies, r_posters = get_recommendations(user_input)
116
-
117
- # Create a list with a list of HTML strings with information
118
- html_code = generate_table(r_movies, r_posters)
119
-
120
- user_input = {}
121
- # Return the output
122
- return f"Your movies are ready!\nPlease check the recommendations below.", np.zeros((500, 500, 3)), html_code
123
 
124
- else:
125
-
126
- # Return the input movie name and poster
127
- return f"You entered {movie} with rating {rating}", poster, ""
 
 
 
 
 
 
 
128
  else:
129
  return f"we can't find {movie} please try again", np.zeros((500, 500, 3)), ""
130
 
 
110
  user_input[f"{data['title']} ({data['year']})"] = rating
111
  poster = get_poster(data['title'])
112
 
113
+ if len(user_input) == 5:
114
+ # Get the recommended movies from the input
115
+ r_movies, r_posters = get_recommendations(user_input)
 
 
 
 
 
 
 
116
 
117
+ # Create a list with a list of HTML strings with information
118
+ html_code = generate_table(r_movies, r_posters)
119
+
120
+ user_input = {}
121
+ # Return the output
122
+ return f"Your movies are ready!\nPlease check the recommendations below.", np.zeros((500, 500, 3)), html_code
123
+
124
+ elif data['status'] == 'True':
125
+
126
+ # Return the input movie name and poster
127
+ return f"You entered {movie} with rating {rating}", poster, ""
128
  else:
129
  return f"we can't find {movie} please try again", np.zeros((500, 500, 3)), ""
130