analytics.showViewed({...}) reads better than track('show_viewed', {...}) and
drops the track_ alias Captions needed, where vidstack already exports track.
The methods are derived from the event catalogue with a mapped type plus a
Proxy rather than written out, so the catalogue stays the only place an event
is declared and the two cannot drift. Names stay snake_case on the wire.
Emitters are cached so a method is referentially stable and safe to pass to a
hook or use as an effect dependency.
Events with no payload are typed void and take no arguments.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Replaces Vercel Analytics with OpenPanel, driven entirely by env vars so the
whole layer is inert until NEXT_PUBLIC_OPENPANEL_CLIENT_ID is set.
Zero initial load cost. next/script emits a rel=preload even on lazyOnload,
which pulls the sdk during the first paint, so the component skips it: it
inlines the 416 byte official stub (window.op queues calls immediately) and
appends the real script itself on window load plus requestIdleCallback. The
built html carries no preload and no script src for the analytics host.
Events live in one typed catalogue (lib/analytics/events.ts) and track() is
keyed to it, so a wrong name or payload is a type error rather than a silent
bad row. Emitters sit in the hooks that already own the behaviour instead of
being sprinkled through components:
- useShowState covers every favourite and watchlist toggle
- useInfiniteList covers pagination for all six lists
- useTorrents covers all three providers
- Preview, Person and useSearch use a shared useTrackOnce hook
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>
Pass the app origin alongside the Toloka thread id so the TV knows
which host to call /api/refresh on.
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>
Add seasonFromEpisodes (single season only, skips ranges) and include
tmdb_id plus the resolved season in the m3u/cast stream params.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The vidstack UI flashed through the splash screen on play. Hide the
player container with opacity while buffering (kept mounted so Safari
autoplay still fires). Also drop the animated border and spinner from
the splash, leaving the center-out reveal and labels.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Detect the /gst transcoder's 502 "unsupported video codec/container"
response, surface a clear in-player message instead of an endless
spinner, and grey out Play for releases that already failed (persisted
by infohash). Replace the buffering spinner with a rounded player and
an animated conic border sweep.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move the pin toggle out of the title cell into the row's action
buttons (next to play) and drop the hover-reveal animation, so the
title column stays clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Cache the fetched magnet of a pinned torrent in localStorage so a
pinned Toloka row stays playable right after a reload without
re-fetching from Toloka; the magnet is dropped when unpinned. Also
switch the pin control to a bookmark icon.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pin torrents (via the pin toggle or automatically on play/stream) so
they stick to the top of the list regardless of the active sort, and
persist the pins to localStorage. The pin sits before the title,
revealing on row hover on desktop and always shown on touch or when
pinned.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
YTS is a movies-only API, so drop its tab and skip its request when
viewing a TV series; the tab grid adapts to the remaining providers.
Co-Authored-By: Claude Fable 5 <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>
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>
Movies get a theatre/stream/blu-ray icon in the info row, series get the
latest aired episode as S03 E07. Both reveal the relevant dates on hover or
tap through a shared Hint tooltip.
Release dates ride along on the details request via append_to_response and
the series fields are already in the tv payload, so neither indicator costs
an extra call. Theatre state is only claimed while the run can still be
current, otherwise a classic with no digital entry would read as in cinemas.
The credits carousel now opens with the director, read from the crew array
that the credits response already carries. A series has no single director,
so the one behind most episodes stands in.
Drop with_cast from the starring query: TMDB ANDs it with with_people, so
every director link would have resolved to an empty list.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
LG webOS (and similar TV browsers) hang when seeking 4K HEVC: hls.js
keeps a large back-buffer and the seek-time flush/re-append spikes
memory past what the TV can handle. Pass a conservative hls.js config
(short backBufferLength, capped max buffer length/size) via the Vidstack
HLS provider; still ample for desktop playback.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Vidstack loads text-track cues via JS; cross-origin subtitle tracks
(served by TorrServer on another origin) need the crossorigin attribute
on the media element to render. Also required for native HLS on iOS/TV
to use the cross-origin stream.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Route MKV/WebM/AVI through TorrServer's native /gst HLS (copy-mode: HEVC
kept, audio->AAC, keyframe-aligned segments with real duration + seeking)
and play MP4 directly. Add an audio-track menu sourced from /gst/probe
(switching reloads with &audio=N and resumes position), surface the HLS
subtitle tracks through the existing captions menu, and show the Play
button for every video container.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
useSortable's `attributes` (role="button", tabIndex, aria-pressed) were
overriding Radix Tabs.Trigger's own role="tab" and roving-tabindex
management, producing an invalid ARIA tab/role combination that
regressed the accessibility audit. `listeners` alone (onPointerDown /
onKeyDown) is sufficient to drive the drag — the trigger is already a
properly accessible, focusable element.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Lets users customize the order of YTS / Pirate Bay / Toloka tabs in the
torrent search modal via drag-and-drop; the saved order also determines
which provider opens by default. dnd-kit is isolated to the modal's
lazily-loaded chunk so it doesn't affect the main bundle.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>