I'm building a personal movie recommender system using TMDB API for displaying movie posters in a React app. When users click on a poster, it returns the movie_id which is provided by the API. The recommendation algorithm runs on the backend. However, I'm facing a problem: the TMDB API shows movies that aren't in my database, leading to errors in my application. I tried filtering the movie_ids through Django to skip any that don't exist in my database, but users sometimes select movies that aren't in there at all. This leaves me with nothing to send to the backend.
2 Answers
Have you considered why you're cross-referencing two different databases? If users can click on movies that don't exist in your database, you might want to rethink allowing those options in the first place. It's a better user experience to show only what's available in your database.
You might want to implement some client-side logic to manage what gets displayed to the user. Perhaps check if the movie_id exists in your database before showing it as an option. This way, users only interact with valid choices and you avoid those pesky errors.
I see your point! The database has a table with movie_id and title, so I'm displaying a set of posters. Users choose 5 movies they like, and their movie_ids are sent to Django for recommendations. But I have no control over what happens on TMDB's end.