feat: replace the starring page with a person page

A credit now opens /person/{id}: portrait, name, department, life dates and
birthplace, the biography, and the full filmography ranked by vote count.
One request carries all of it — combined_credits rides along on the person
call — so the discover based starring query and its with_people filter go.

The biography fills whatever height the portrait leaves and fades where it
is cut, with the whole text in a tooltip on hover; a phone has no height to
respect there, so it simply runs on.

Route level and query level skeletons stand in while it loads, built from
the shadcn primitive.

Development server side fetches go over the loopback rather than SITE_URL,
which is a LAN address meant for other devices: once that address moves the
fetch hangs until undici times out, ten seconds per navigation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
nerandClaude Opus 5 committed 2026-08-04 22:09:33 +03:00
1 parent 6fc41c0901
commit 3dc2ebfe53
22 files changed
+342 -108

No files matched your search

-1
View File
@@ -6,7 +6,6 @@ export const mapDetailsToAiring = ({
number_of_seasons,
status
}: TMDBSeriesDetails): Airing | undefined => {
// before a premiere there is nothing aired yet, the upcoming episode is the only position we have
const current = last_episode_to_air || next_episode_to_air;
if (!current) return undefined;
-5
View File
@@ -1,4 +1,3 @@
// TMDB release types: 1 premiere, 2 limited theatrical, 3 theatrical, 4 digital, 5 physical, 6 TV
const STATE_BY_RELEASE_TYPE: Record<number, AvailabilityState> = {
1: 'theatre',
2: 'theatre',
@@ -7,11 +6,9 @@ const STATE_BY_RELEASE_TYPE: Record<number, AvailabilityState> = {
5: 'bluray'
};
/** How long a movie is assumed to still be running in theatres when TMDB has no digital/physical date yet */
const THEATRICAL_WINDOW = 120 * 24 * 60 * 60 * 1000;
export const mapReleaseDatesToAvailability = (results?: TMDBCountryReleaseDates[]): Availability | undefined => {
// TMDB reports dates per country, it doesn't matter where a window opened first — only when
const availability = (results || []).reduce<Availability>((dates, { release_dates }) => {
(release_dates || []).forEach(({ type, release_date }) => {
const state = STATE_BY_RELEASE_TYPE[type];
@@ -37,8 +34,6 @@ export const getAvailabilityState = ({ theatre, stream, bluray }: Availability):
if (isUpcoming(theatre)) return 'theatre';
if (!theatre) return undefined;
// Still in theatres only while the run lasts or while a digital/physical date is announced but not reached,
// otherwise TMDB simply never got the digital entry and the movie is long out of cinemas
const isRunning = Date.now() - Date.parse(theatre) < THEATRICAL_WINDOW;
return isRunning || isUpcoming(stream) || isUpcoming(bluray) ? 'theatre' : 'stream';
+31
View File
@@ -0,0 +1,31 @@
import { mapMovieSeriesToShow } from './Show';
const unique = (credits: TMDBPersonCredit[]) => {
const titles = new Map<string, TMDBPersonCredit>();
credits.forEach((credit) => {
const key = `${credit.media_type}-${credit.id}`;
if (credit.poster_path && ['movie', 'tv'].includes(credit.media_type) && !titles.has(key)) {
titles.set(key, credit);
}
});
return Array.from(titles.values());
};
const mapPersonToProfile = ({ combined_credits, ...person }: TMDBPersonDetails): Profile => ({
id: person.id,
name: person.name,
photo: person.profile_path ? `https://image.tmdb.org/t/p/w500${person.profile_path}` : '',
biography: person.biography || '',
department: person.known_for_department || '',
birthday: person.birthday || undefined,
deathday: person.deathday || undefined,
birthplace: person.place_of_birth || undefined,
shows: unique([...(combined_credits?.cast || []), ...(combined_credits?.crew || [])])
.sort((a, b) => b.vote_count - a.vote_count)
.map((credit) => mapMovieSeriesToShow(credit, credit.media_type))
});
export default mapPersonToProfile;