Version 0.2.1
Last updated: 2023-04-17
Better recommendations
Description
Optimization of the Recommender System. The fact that often no recommendation could be found when using keywords is due to the fact that keywords are very unique and do not overlap greatly across different movies. Therefore, combinations can arise for which there is no movie.
To change this, we switched from keywords to genres, because there is more overlap. However, the recommendations are still accurate and relevant.
Changes
The changes are the same as in “Version 0.2.0” but with renamed variables and changed URLs.
The following changes and implementations have been made in that version of the project:
- Big changes to the database
- New model “Genres”
- If a movie gets liked, the genres are added to the movie
How do we get the recommended movies?
- When visiting the page, all genres are queried that the user liked
- From those genres, the top 3 genres are evaluated based on frequency
- With these genres an API request is sent to TheMovieDB which returns movies with these genres
- From the response, the movies that the user has liked are filtered out
Bug fixes:
- Better fetch of the movie details by using
await Promise.all
Features
✅ Better recommendations 🛠️
Code
The changes are the same as in “Version 0.2.0” but with renamed variables and changed URLs.
Using await Promise.all allowed us to improve the loading time for the details page. This was done like the following.
movie/[id]/+page.server.ts
// fetching like this allows both requests to be awaited simultaneously
// therefore the load is quicker
const [movieDetailResponse, movieAvailabilityResponse] = await Promise.all([
fetch(`url1`),
fetch(`url2`)
]);
Commit: Version 0.2.1
Published: 2023-04-03