Move the trimmer from the route into a shared lib/tmdbTrim and apply it in
the server-side client too (server hits TMDB directly, bypassing the proxy),
so both paths return identical shapes. Show page HTML drops ~22%
(88.4KB -> 68.8KB); TV details payload -90%.
Three exceeded Vercel free tier limits (edge requests, function invocations,
fast origin transfer) all traced back to nothing being cached.
- Http defaults preventCache to false and the tmdb proxy now sends a real
Cache-Control, so public responses are edge cached instead of missing on
every request. Session scoped calls keep private, no-store.
- On the server movieAdvisor talks to tmdb directly. It used to fetch its own
public /api/tmdb url, billing a second edge request, a second function
invocation and the whole payload as origin transfer per server render.
- Add generateStaticParams to movie, tv and person pages. Without it Next
treats the segment as fully dynamic and ignores revalidate, so the pages
re-rendered on every request instead of using ISR.
- Trim credits and person payloads in the proxy: credits 72kb to 13kb,
aggregate_credits 308kb to 102kb, person 191kb to 124kb. Only fields no
mapper reads are dropped, mapped output is unchanged.
- Detail pages are cached now, so only a real tmdb 404 becomes notFound and
other failures bubble up instead of being baked in as a 404 for a day.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add an OpenSubtitles client, /api/subtitles routes and useSubtitles to
fetch subtitles by show/episode/filename, wire them as player tracks
alongside embedded ones, and strip hls.js's auto-added tracks. New
OPENSUBTITLES_* / SUBTITLE_LANGUAGES env vars (documented in env.example).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add /api/refresh?tid=<id> that re-downloads a Toloka thread's .torrent
server-side and returns a fresh magnet + m3u. Pass the thread id (tlk)
into the m3u params for series. Drop the per-magnet cache so refreshes
always reflect the thread's current state (new episodes while airing).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- parse Toloka Ukrainian season/episode naming (Сезони 1-10,
серій 7 з 8, homoglyphs) into a clean title + episodes field
- add series-only sortable S:E column, desktop-only Year column;
strip year/source meta from the title cell
- filter out torrents with fewer than 5 seeders in the API route
- cache Toloka magnets in Redis so each .torrent is downloaded once
across serverless instances; append public trackers to magnets
(never the passkey-bearing announce URLs from the .torrent)
- fix play button hover state while magnet is pending
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>