Finish the Browse Experience
8 min read
Match TMDB Search Behavior
Match TMDB Search Behavior
Make the application’s browse rules agree with the two different TMDB endpoints it uses.
Step 1 — Keep the endpoint branch in discoverMovies
Text queries should continue to use /search/movie; empty text queries should use /discover/movie.
if (query && query.trim().length > 0) {
data = await tmdbFetch("/search/movie", {
Step 2 — Do not mix discovery filters into text search
When a query exists, send only the search-specific parameters. Genre and sort belong to the discovery request. This mirrors the actual API behavior used by Matinee.
Step 3 — Hide discovery pagination during text search
In app/page.tsx, render the pagination block only when the query is empty.
{query.trim() === "" && (
<div className="pagination">
This keeps the browse controls consistent with the endpoint that is currently active.
Checkpoint
Enter a title while a genre or sort is selected. Text search should take priority, and the discovery pagination should disappear until the query is cleared.