Why is my Movie Recommender Pulling Data Not in My Database?

0
1
Asked By CleverPotato92 On

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

Answered By CuriousCoder88 On

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.

CleverPotato92 -

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.

Answered By TechieTed On

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.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.