CodingNic

Finish the Browse Experience

Match TMDB Search Behavior

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.

typescript
if (query && query.trim().length > 0) {
  data = await tmdbFetch("/search/movie", {

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.

In app/page.tsx, render the pagination block only when the query is empty.

tsx
{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.