Files
movie-advisor/app/(site)/popular/page.tsx
T
ner f22f3c45b4 feat(show-type): path-based /series filter and infinite trending galleries
Persist the show-type filter in the path via a /series prefix: movies
keep bare URLs, series use /series across random, popular, top,
favorites and watchlist. The path is the single source of truth - the
jotai atom is removed and the toggle navigates with router.replace so
the server prefetches the target variant. Legacy ?type=tv deep links
redirect to the prefixed URLs.

Trending and similar/recommendations queries are now paginated and feed
useInfiniteList like the main lists. Gallery wires fetchNextPage to a
new ScrollNavigation onEndReached callback (fires within two slides of
the end, once per approach), so all gallery tabs load more on scroll.
The show page prefetches the first similar page with
prefetchInfiniteQuery, and trending/similar/recommendations are added
to the analytics ListName.
2026-09-24 15:54:40 +03:00

42 lines
961 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { Metadata } from 'next';
import { redirect } from 'next/navigation';
import { TITLE } from '@/env';
import PopularContent from './content';
const HEADING = 'Popular Movies';
const DESCRIPTION = `Check out the most popular movies right now on ${TITLE}. See what’s trending and don’t miss out on the latest hits.`;
export const metadata: Metadata = {
title: `${HEADING} | ${TITLE}`,
description: DESCRIPTION,
alternates: { canonical: '/popular' },
openGraph: {
type: 'website',
siteName: TITLE,
title: HEADING,
description: DESCRIPTION,
url: '/popular'
},
twitter: {
title: HEADING,
description: DESCRIPTION
}
};
interface SearchParams {
type?: string;
}
const Popular = async ({ searchParams }: { searchParams: SearchParams }) => {
if (searchParams.type === 'tv') redirect('/series/popular');
return <PopularContent type='movie' />;
};
export const revalidate = 3600;
export default Popular;