Replace search page with explore page for rich discovery experience

The command palette (⌘K) already handles direct title search. Replace the
redundant /search page with a new /explore page featuring trending titles,
popular movies/TV, and genre browsing powered by TMDB discovery endpoints.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 15:11:53 -05:00
co-authored by Claude Opus 4.6
parent cddef34909
commit e098180dda
14 changed files with 653 additions and 120 deletions
+48
View File
@@ -0,0 +1,48 @@
import { type NextRequest, NextResponse } from "next/server";
import { isTmdbConfigured } from "@/lib/config";
import { discover } from "@/lib/tmdb/client";
export async function GET(req: NextRequest) {
if (!isTmdbConfigured()) {
return NextResponse.json(
{
error: "TMDB API key is not configured. Visit /setup for instructions.",
code: "TMDB_NOT_CONFIGURED",
},
{ status: 503 },
);
}
const { searchParams } = req.nextUrl;
const type = searchParams.get("type") === "tv" ? "tv" : "movie";
const genre = searchParams.get("genre");
const sortBy = searchParams.get("sort_by") || "popularity.desc";
const page = searchParams.get("page") || "1";
const params: Record<string, string> = {
sort_by: sortBy,
"vote_count.gte": "50",
};
if (genre) {
params.with_genres = genre;
}
const results = await discover(type, params, Number(page));
const filtered = results.results.filter((r) => r.poster_path);
return NextResponse.json({
results: filtered.map((r) => ({
tmdbId: r.id,
type,
title: r.title ?? r.name,
overview: r.overview,
releaseDate: r.release_date ?? r.first_air_date,
posterPath: r.poster_path,
popularity: r.popularity,
voteAverage: r.vote_average,
})),
page: results.page,
totalPages: results.total_pages,
});
}