vnoelifant / movie-search-app

0 stars 0 forks source link

Add movie detail cache data to models #22

Closed vnoelifant closed 10 months ago

bbelderbos commented 1 year ago

Let me know what data we'll cache. For starters I would go with:

1) Search (input) table to save who searches for what

2) Movie table to save basic movie data like: title, year, runtime, country, genres, rating, plot. I think this is in the base data of what you're already getting back from the API with your search queries.

Maybe not in the base data but worth getting is the YouTube trailer code / link.

I think directory and actors might be another endpoint so would skip that. And we want the poster image which I'd expect to be in the base data too. With the exception of "rating" this is static data that won't change (even rating should be pretty "stable" if it's an average of many votes) so we don't have to query the API again to update it.

This is also pretty similar how we do it with books @ https://pybitesbooks.com -> code repo: https://github.com/PyBites-Open-Source/pybitesbooks


Search results I would not cache because it's pretty volatile data, it can change anytime as TMDB updates their database with new movies.

Funny I worked on this a long time ago: https://bobbelderbos.com/tags.html#sharemovies-ref

image
vnoelifant commented 10 months ago

The movie detail, recommendations, videos and genres I believe are cached per https://github.com/vnoelifant/movie-search-app/blob/movie-detail-updates/movie_search/media.py. I will need to review the code again to see if I missed something. Once I figure that out I'll create a new issue, so I'll close this as a first iteration.