2026-07-05 21:27:02 +02:00
|
|
|
|
import { lazy, Suspense, useEffect, useLayoutEffect, useRef, type CSSProperties } from "react";
|
2026-07-05 02:32:00 +02:00
|
|
|
|
import { useTranslation } from "react-i18next";
|
2026-07-05 05:26:16 +02:00
|
|
|
|
import { useInfiniteQuery, useQuery, useQueryClient } from "@tanstack/react-query";
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
import { ArrowLeft, CheckCircle2, Info, Play } from "lucide-react";
|
2026-07-06 00:56:01 +02:00
|
|
|
|
import { api, type PlexCard, type PlexFilters, type PlexPerson } from "../lib/api";
|
2026-07-05 02:32:00 +02:00
|
|
|
|
import { useDebounced } from "../lib/useDebounced";
|
2026-07-05 03:29:20 +02:00
|
|
|
|
import { useHistorySubview } from "../lib/history";
|
2026-07-05 02:32:00 +02:00
|
|
|
|
|
feat(plex): P2 player — rich full-page HLS/direct player + watch-state
- backend: GET /api/plex/item/{rk} detail (metadata, cast + intro/credit markers
from Plex, episode prev/next, per-user resume+status); POST /item/{rk}/progress
(resume checkpoint, near-end→watched) + /state (new|watched|hidden).
- frontend PlexPlayer.tsx (lazy, pulls hls.js): full-page player over the Plex
module. Direct files stream raw <video>; remux via hls.js on the seek-restart
session — custom controls map the ABSOLUTE timeline over the session offset, and a
seek beyond the loaded region restarts the session at the target. Play/pause/resume
/restart, ±10s seek, prev/next episode (Shift+←/→), volume, windowed/fullscreen,
full keyboard, Skip intro/Skip credits from markers (shaded on the seekbar),
auto-advance + watched-on-end, resume from saved position, 10s progress checkpoints.
- PlexBrowse: card/episode click opens the player as a history subview (browser Back
returns to the grid/show). api client (plexItem/plexSession/plexProgress/plexSetState)
+ types; plex.player.* i18n en/hu/de. hls.js@^1.6.16.
- Verified over HTTP: detail w/ markers+cast+episode-nav, progress persist. Video
playback itself is pending browser UAT. Subtitle/audio track SELECTION deferred.
2026-07-05 04:28:00 +02:00
|
|
|
|
// Lazy: the rich player (pulls in hls.js) loads only when something is first played.
|
|
|
|
|
|
const PlexPlayer = lazy(() => import("./PlexPlayer"));
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
const PlexInfo = lazy(() => import("./PlexInfo"));
|
feat(plex): Playlists Phase 1 — per-user ordered watch-lists (Siftlode-native)
Personal ordered lists of Plex items, kept in Siftlode's own DB (works for users
without a Plex account, like watch-state) — the "your own lists" counterpart to
shared collections. Plex-direction sync is a later phase (plex_rating_key
reserved).
Backend: migration 0048 (plex_playlists + plex_playlist_items with position),
PlexPlaylist/PlexPlaylistItem models, and per-user CRUD endpoints under
/api/plex/playlists (list [+?contains for the add dialog], create [seeded],
detail [ordered cards], rename, delete, add/remove item, reorder). _leaf_card
handles the movie/episode mix. Frontend: "Add to playlist" dialog from the movie
info page (all users), a Playlists section in PlexSidebar (list + create),
PlexPlaylistView (reorder up/down, remove, rename, delete, Play all), and
PlexPlayer gained an optional `queue` so play-through follows the list order
(prev/next + auto-advance). i18n en/hu/de. Verified end-to-end on localdev
(backend CRUD + the create→add→view→play-through UI flow).
2026-07-06 19:05:12 +02:00
|
|
|
|
const PlexPlaylistView = lazy(() => import("./PlexPlaylistView"));
|
feat(plex): P2 player — rich full-page HLS/direct player + watch-state
- backend: GET /api/plex/item/{rk} detail (metadata, cast + intro/credit markers
from Plex, episode prev/next, per-user resume+status); POST /item/{rk}/progress
(resume checkpoint, near-end→watched) + /state (new|watched|hidden).
- frontend PlexPlayer.tsx (lazy, pulls hls.js): full-page player over the Plex
module. Direct files stream raw <video>; remux via hls.js on the seek-restart
session — custom controls map the ABSOLUTE timeline over the session offset, and a
seek beyond the loaded region restarts the session at the target. Play/pause/resume
/restart, ±10s seek, prev/next episode (Shift+←/→), volume, windowed/fullscreen,
full keyboard, Skip intro/Skip credits from markers (shaded on the seekbar),
auto-advance + watched-on-end, resume from saved position, 10s progress checkpoints.
- PlexBrowse: card/episode click opens the player as a history subview (browser Back
returns to the grid/show). api client (plexItem/plexSession/plexProgress/plexSetState)
+ types; plex.player.* i18n en/hu/de. hls.js@^1.6.16.
- Verified over HTTP: detail w/ markers+cast+episode-nav, progress persist. Video
playback itself is pending browser UAT. Subtitle/audio track SELECTION deferred.
2026-07-05 04:28:00 +02:00
|
|
|
|
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
type Sub =
|
|
|
|
|
|
| { kind: "grid" }
|
|
|
|
|
|
| { kind: "show"; id: string }
|
feat(plex): Playlists Phase 1 — per-user ordered watch-lists (Siftlode-native)
Personal ordered lists of Plex items, kept in Siftlode's own DB (works for users
without a Plex account, like watch-state) — the "your own lists" counterpart to
shared collections. Plex-direction sync is a later phase (plex_rating_key
reserved).
Backend: migration 0048 (plex_playlists + plex_playlist_items with position),
PlexPlaylist/PlexPlaylistItem models, and per-user CRUD endpoints under
/api/plex/playlists (list [+?contains for the add dialog], create [seeded],
detail [ordered cards], rename, delete, add/remove item, reorder). _leaf_card
handles the movie/episode mix. Frontend: "Add to playlist" dialog from the movie
info page (all users), a Playlists section in PlexSidebar (list + create),
PlexPlaylistView (reorder up/down, remove, rename, delete, Play all), and
PlexPlayer gained an optional `queue` so play-through follows the list order
(prev/next + auto-advance). i18n en/hu/de. Verified end-to-end on localdev
(backend CRUD + the create→add→view→play-through UI flow).
2026-07-06 19:05:12 +02:00
|
|
|
|
| { kind: "player"; id: string; queue?: string[] }
|
|
|
|
|
|
| { kind: "info"; id: string }
|
|
|
|
|
|
| { kind: "playlist"; id: number };
|
feat(plex): P2 player — rich full-page HLS/direct player + watch-state
- backend: GET /api/plex/item/{rk} detail (metadata, cast + intro/credit markers
from Plex, episode prev/next, per-user resume+status); POST /item/{rk}/progress
(resume checkpoint, near-end→watched) + /state (new|watched|hidden).
- frontend PlexPlayer.tsx (lazy, pulls hls.js): full-page player over the Plex
module. Direct files stream raw <video>; remux via hls.js on the seek-restart
session — custom controls map the ABSOLUTE timeline over the session offset, and a
seek beyond the loaded region restarts the session at the target. Play/pause/resume
/restart, ±10s seek, prev/next episode (Shift+←/→), volume, windowed/fullscreen,
full keyboard, Skip intro/Skip credits from markers (shaded on the seekbar),
auto-advance + watched-on-end, resume from saved position, 10s progress checkpoints.
- PlexBrowse: card/episode click opens the player as a history subview (browser Back
returns to the grid/show). api client (plexItem/plexSession/plexProgress/plexSetState)
+ types; plex.player.* i18n en/hu/de. hls.js@^1.6.16.
- Verified over HTTP: detail w/ markers+cast+episode-nav, progress persist. Video
playback itself is pending browser UAT. Subtitle/audio track SELECTION deferred.
2026-07-05 04:28:00 +02:00
|
|
|
|
|
2026-07-05 03:29:20 +02:00
|
|
|
|
// The Plex module's content area: browse/search the mirrored library as poster cards, drill from a
|
|
|
|
|
|
// show into seasons/episodes. Library scope / watch-state / sort live in the left PlexSidebar; the
|
|
|
|
|
|
// search term comes from the shared top Header search box (q). A show drill-down rides history
|
|
|
|
|
|
// (useHistorySubview) so browser Back returns to the grid. Playback lands in P2 — a card announces
|
|
|
|
|
|
// for now. Rendered by App for page==="plex" (its own nav module).
|
2026-07-05 02:32:00 +02:00
|
|
|
|
|
feat(plex): expanded metadata filters, clickable info page, image disk cache
Backend (migration 0045_plex_filter_meta): plex_items gains rating (audienceRating
~IMDb), content_rating, studio, originally_available_at, and GIN-indexed genres /
directors / cast_names — all mirrored from the cheap section listing (no per-item API
calls; they also seed a future watch-habit recommender). /browse gains genre / content-
rating / year / rating / duration / added-within / director / actor / studio filters
(@> containment, GIN) + sort by year|rating|duration|release; new /facets endpoint
returns available genres+ratings (with counts) and the year/rating/duration bounds. A
thin on-disk image cache (.plex-img-cache) serves posters/art/cast photos from local
disk after first fetch (~7-14x faster repeat loads).
Frontend: PlexSidebar grows the full filter set (facet-driven genre/age chips, rating
steps, year range inputs, duration buckets, added-within, active people/studio chips,
clear-all); filters persist per-account as one JSON blob. PlexInfo metadata (year,
genre, director, cast, studio, IMDb score) is clickable → sets the matching filter and
returns to the filtered grid (page variant only; the in-player overlay stays read-only
so a stray click can't stop playback). i18n en/hu/de.
2026-07-05 23:45:55 +02:00
|
|
|
|
type Props = {
|
|
|
|
|
|
q: string;
|
2026-07-06 00:56:01 +02:00
|
|
|
|
onClearSearch: () => void;
|
feat(plex): expanded metadata filters, clickable info page, image disk cache
Backend (migration 0045_plex_filter_meta): plex_items gains rating (audienceRating
~IMDb), content_rating, studio, originally_available_at, and GIN-indexed genres /
directors / cast_names — all mirrored from the cheap section listing (no per-item API
calls; they also seed a future watch-habit recommender). /browse gains genre / content-
rating / year / rating / duration / added-within / director / actor / studio filters
(@> containment, GIN) + sort by year|rating|duration|release; new /facets endpoint
returns available genres+ratings (with counts) and the year/rating/duration bounds. A
thin on-disk image cache (.plex-img-cache) serves posters/art/cast photos from local
disk after first fetch (~7-14x faster repeat loads).
Frontend: PlexSidebar grows the full filter set (facet-driven genre/age chips, rating
steps, year range inputs, duration buckets, added-within, active people/studio chips,
clear-all); filters persist per-account as one JSON blob. PlexInfo metadata (year,
genre, director, cast, studio, IMDb score) is clickable → sets the matching filter and
returns to the filtered grid (page variant only; the in-player overlay stays read-only
so a stray click can't stop playback). i18n en/hu/de.
2026-07-05 23:45:55 +02:00
|
|
|
|
library: string;
|
|
|
|
|
|
show: string;
|
|
|
|
|
|
sort: string;
|
|
|
|
|
|
filters: PlexFilters;
|
|
|
|
|
|
setFilters: (f: PlexFilters) => void;
|
feat(plex): Playlists Phase 1 — per-user ordered watch-lists (Siftlode-native)
Personal ordered lists of Plex items, kept in Siftlode's own DB (works for users
without a Plex account, like watch-state) — the "your own lists" counterpart to
shared collections. Plex-direction sync is a later phase (plex_rating_key
reserved).
Backend: migration 0048 (plex_playlists + plex_playlist_items with position),
PlexPlaylist/PlexPlaylistItem models, and per-user CRUD endpoints under
/api/plex/playlists (list [+?contains for the add dialog], create [seeded],
detail [ordered cards], rename, delete, add/remove item, reorder). _leaf_card
handles the movie/episode mix. Frontend: "Add to playlist" dialog from the movie
info page (all users), a Playlists section in PlexSidebar (list + create),
PlexPlaylistView (reorder up/down, remove, rename, delete, Play all), and
PlexPlayer gained an optional `queue` so play-through follows the list order
(prev/next + auto-advance). i18n en/hu/de. Verified end-to-end on localdev
(backend CRUD + the create→add→view→play-through UI flow).
2026-07-06 19:05:12 +02:00
|
|
|
|
// The sidebar opens a playlist by setting this; PlexBrowse turns it into a history subview + clears it.
|
|
|
|
|
|
openPlaylist?: number | null;
|
|
|
|
|
|
onPlaylistOpened?: () => void;
|
feat(plex): expanded metadata filters, clickable info page, image disk cache
Backend (migration 0045_plex_filter_meta): plex_items gains rating (audienceRating
~IMDb), content_rating, studio, originally_available_at, and GIN-indexed genres /
directors / cast_names — all mirrored from the cheap section listing (no per-item API
calls; they also seed a future watch-habit recommender). /browse gains genre / content-
rating / year / rating / duration / added-within / director / actor / studio filters
(@> containment, GIN) + sort by year|rating|duration|release; new /facets endpoint
returns available genres+ratings (with counts) and the year/rating/duration bounds. A
thin on-disk image cache (.plex-img-cache) serves posters/art/cast photos from local
disk after first fetch (~7-14x faster repeat loads).
Frontend: PlexSidebar grows the full filter set (facet-driven genre/age chips, rating
steps, year range inputs, duration buckets, added-within, active people/studio chips,
clear-all); filters persist per-account as one JSON blob. PlexInfo metadata (year,
genre, director, cast, studio, IMDb score) is clickable → sets the matching filter and
returns to the filtered grid (page variant only; the in-player overlay stays read-only
so a stray click can't stop playback). i18n en/hu/de.
2026-07-05 23:45:55 +02:00
|
|
|
|
};
|
2026-07-05 02:32:00 +02:00
|
|
|
|
|
|
|
|
|
|
const PAGE = 40;
|
|
|
|
|
|
|
2026-07-05 03:29:20 +02:00
|
|
|
|
function dur(n?: number | null): string {
|
2026-07-05 02:32:00 +02:00
|
|
|
|
if (!n) return "";
|
|
|
|
|
|
const h = Math.floor(n / 3600);
|
|
|
|
|
|
const m = Math.floor((n % 3600) / 60);
|
|
|
|
|
|
return h ? `${h}h ${m}m` : `${m}m`;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
feat(plex): Playlists Phase 1 — per-user ordered watch-lists (Siftlode-native)
Personal ordered lists of Plex items, kept in Siftlode's own DB (works for users
without a Plex account, like watch-state) — the "your own lists" counterpart to
shared collections. Plex-direction sync is a later phase (plex_rating_key
reserved).
Backend: migration 0048 (plex_playlists + plex_playlist_items with position),
PlexPlaylist/PlexPlaylistItem models, and per-user CRUD endpoints under
/api/plex/playlists (list [+?contains for the add dialog], create [seeded],
detail [ordered cards], rename, delete, add/remove item, reorder). _leaf_card
handles the movie/episode mix. Frontend: "Add to playlist" dialog from the movie
info page (all users), a Playlists section in PlexSidebar (list + create),
PlexPlaylistView (reorder up/down, remove, rename, delete, Play all), and
PlexPlayer gained an optional `queue` so play-through follows the list order
(prev/next + auto-advance). i18n en/hu/de. Verified end-to-end on localdev
(backend CRUD + the create→add→view→play-through UI flow).
2026-07-06 19:05:12 +02:00
|
|
|
|
export default function PlexBrowse({
|
|
|
|
|
|
q,
|
|
|
|
|
|
onClearSearch,
|
|
|
|
|
|
library,
|
|
|
|
|
|
show,
|
|
|
|
|
|
sort,
|
|
|
|
|
|
filters,
|
|
|
|
|
|
setFilters,
|
|
|
|
|
|
openPlaylist,
|
|
|
|
|
|
onPlaylistOpened,
|
|
|
|
|
|
}: Props) {
|
2026-07-05 02:32:00 +02:00
|
|
|
|
const { t } = useTranslation();
|
2026-07-05 05:26:16 +02:00
|
|
|
|
const qc = useQueryClient();
|
2026-07-05 02:32:00 +02:00
|
|
|
|
const dq = useDebounced(q.trim(), 350);
|
feat(plex): P2 player — rich full-page HLS/direct player + watch-state
- backend: GET /api/plex/item/{rk} detail (metadata, cast + intro/credit markers
from Plex, episode prev/next, per-user resume+status); POST /item/{rk}/progress
(resume checkpoint, near-end→watched) + /state (new|watched|hidden).
- frontend PlexPlayer.tsx (lazy, pulls hls.js): full-page player over the Plex
module. Direct files stream raw <video>; remux via hls.js on the seek-restart
session — custom controls map the ABSOLUTE timeline over the session offset, and a
seek beyond the loaded region restarts the session at the target. Play/pause/resume
/restart, ±10s seek, prev/next episode (Shift+←/→), volume, windowed/fullscreen,
full keyboard, Skip intro/Skip credits from markers (shaded on the seekbar),
auto-advance + watched-on-end, resume from saved position, 10s progress checkpoints.
- PlexBrowse: card/episode click opens the player as a history subview (browser Back
returns to the grid/show). api client (plexItem/plexSession/plexProgress/plexSetState)
+ types; plex.player.* i18n en/hu/de. hls.js@^1.6.16.
- Verified over HTTP: detail w/ markers+cast+episode-nav, progress persist. Video
playback itself is pending browser UAT. Subtitle/audio track SELECTION deferred.
2026-07-05 04:28:00 +02:00
|
|
|
|
const sub = useHistorySubview<Sub>({ kind: "grid" });
|
2026-07-05 02:32:00 +02:00
|
|
|
|
|
feat(plex): Playlists Phase 1 — per-user ordered watch-lists (Siftlode-native)
Personal ordered lists of Plex items, kept in Siftlode's own DB (works for users
without a Plex account, like watch-state) — the "your own lists" counterpart to
shared collections. Plex-direction sync is a later phase (plex_rating_key
reserved).
Backend: migration 0048 (plex_playlists + plex_playlist_items with position),
PlexPlaylist/PlexPlaylistItem models, and per-user CRUD endpoints under
/api/plex/playlists (list [+?contains for the add dialog], create [seeded],
detail [ordered cards], rename, delete, add/remove item, reorder). _leaf_card
handles the movie/episode mix. Frontend: "Add to playlist" dialog from the movie
info page (all users), a Playlists section in PlexSidebar (list + create),
PlexPlaylistView (reorder up/down, remove, rename, delete, Play all), and
PlexPlayer gained an optional `queue` so play-through follows the list order
(prev/next + auto-advance). i18n en/hu/de. Verified end-to-end on localdev
(backend CRUD + the create→add→view→play-through UI flow).
2026-07-06 19:05:12 +02:00
|
|
|
|
// Sidebar asked to open a playlist → push it as a subview (browser Back returns to the grid), then
|
|
|
|
|
|
// clear the signal so it doesn't re-open.
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
if (openPlaylist != null) {
|
|
|
|
|
|
sub.open({ kind: "playlist", id: openPlaylist });
|
|
|
|
|
|
onPlaylistOpened?.();
|
|
|
|
|
|
}
|
|
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
|
|
}, [openPlaylist]);
|
|
|
|
|
|
|
2026-07-05 21:27:02 +02:00
|
|
|
|
// Opening a show/player replaces the grid entirely (the component returns early below), so the
|
|
|
|
|
|
// scroll container resets to the top. Remember where the grid was scrolled when leaving it, and
|
|
|
|
|
|
// restore it when we come back — so the browser/mouse Back from the player lands on the same card
|
|
|
|
|
|
// instead of the top of the library. The scroller is App's <main> (the page's overflow-y-auto).
|
|
|
|
|
|
const scrollRef = useRef(0);
|
2026-07-06 06:50:03 +02:00
|
|
|
|
// Same idea for the info page: "Browse collection" (onFilter) leaves the info view for a filtered
|
|
|
|
|
|
// grid, and browser Back returns to this same info page — restore where the user had scrolled it
|
|
|
|
|
|
// (down to a collection strip) instead of snapping to the top. Reset on a fresh info open so a
|
|
|
|
|
|
// different title's info starts at the top.
|
|
|
|
|
|
const infoScrollRef = useRef(0);
|
2026-07-05 21:27:02 +02:00
|
|
|
|
const scroller = () => document.querySelector("main");
|
|
|
|
|
|
useLayoutEffect(() => {
|
2026-07-06 06:50:03 +02:00
|
|
|
|
const el = scroller();
|
|
|
|
|
|
if (!el) return;
|
|
|
|
|
|
if (sub.view.kind === "grid" && scrollRef.current) el.scrollTop = scrollRef.current;
|
|
|
|
|
|
else if (sub.view.kind === "info" && infoScrollRef.current) el.scrollTop = infoScrollRef.current;
|
2026-07-05 21:27:02 +02:00
|
|
|
|
}, [sub.view.kind]);
|
|
|
|
|
|
|
2026-07-05 02:32:00 +02:00
|
|
|
|
const browseQ = useInfiniteQuery({
|
feat(plex): expanded metadata filters, clickable info page, image disk cache
Backend (migration 0045_plex_filter_meta): plex_items gains rating (audienceRating
~IMDb), content_rating, studio, originally_available_at, and GIN-indexed genres /
directors / cast_names — all mirrored from the cheap section listing (no per-item API
calls; they also seed a future watch-habit recommender). /browse gains genre / content-
rating / year / rating / duration / added-within / director / actor / studio filters
(@> containment, GIN) + sort by year|rating|duration|release; new /facets endpoint
returns available genres+ratings (with counts) and the year/rating/duration bounds. A
thin on-disk image cache (.plex-img-cache) serves posters/art/cast photos from local
disk after first fetch (~7-14x faster repeat loads).
Frontend: PlexSidebar grows the full filter set (facet-driven genre/age chips, rating
steps, year range inputs, duration buckets, added-within, active people/studio chips,
clear-all); filters persist per-account as one JSON blob. PlexInfo metadata (year,
genre, director, cast, studio, IMDb score) is clickable → sets the matching filter and
returns to the filtered grid (page variant only; the in-player overlay stays read-only
so a stray click can't stop playback). i18n en/hu/de.
2026-07-05 23:45:55 +02:00
|
|
|
|
queryKey: ["plex-browse", library, dq, sort, show, filters],
|
feat(plex): P2 player — rich full-page HLS/direct player + watch-state
- backend: GET /api/plex/item/{rk} detail (metadata, cast + intro/credit markers
from Plex, episode prev/next, per-user resume+status); POST /item/{rk}/progress
(resume checkpoint, near-end→watched) + /state (new|watched|hidden).
- frontend PlexPlayer.tsx (lazy, pulls hls.js): full-page player over the Plex
module. Direct files stream raw <video>; remux via hls.js on the seek-restart
session — custom controls map the ABSOLUTE timeline over the session offset, and a
seek beyond the loaded region restarts the session at the target. Play/pause/resume
/restart, ±10s seek, prev/next episode (Shift+←/→), volume, windowed/fullscreen,
full keyboard, Skip intro/Skip credits from markers (shaded on the seekbar),
auto-advance + watched-on-end, resume from saved position, 10s progress checkpoints.
- PlexBrowse: card/episode click opens the player as a history subview (browser Back
returns to the grid/show). api client (plexItem/plexSession/plexProgress/plexSetState)
+ types; plex.player.* i18n en/hu/de. hls.js@^1.6.16.
- Verified over HTTP: detail w/ markers+cast+episode-nav, progress persist. Video
playback itself is pending browser UAT. Subtitle/audio track SELECTION deferred.
2026-07-05 04:28:00 +02:00
|
|
|
|
enabled: !!library && sub.view.kind === "grid",
|
2026-07-05 02:32:00 +02:00
|
|
|
|
initialPageParam: 0,
|
|
|
|
|
|
queryFn: ({ pageParam }) =>
|
feat(plex): expanded metadata filters, clickable info page, image disk cache
Backend (migration 0045_plex_filter_meta): plex_items gains rating (audienceRating
~IMDb), content_rating, studio, originally_available_at, and GIN-indexed genres /
directors / cast_names — all mirrored from the cheap section listing (no per-item API
calls; they also seed a future watch-habit recommender). /browse gains genre / content-
rating / year / rating / duration / added-within / director / actor / studio filters
(@> containment, GIN) + sort by year|rating|duration|release; new /facets endpoint
returns available genres+ratings (with counts) and the year/rating/duration bounds. A
thin on-disk image cache (.plex-img-cache) serves posters/art/cast photos from local
disk after first fetch (~7-14x faster repeat loads).
Frontend: PlexSidebar grows the full filter set (facet-driven genre/age chips, rating
steps, year range inputs, duration buckets, added-within, active people/studio chips,
clear-all); filters persist per-account as one JSON blob. PlexInfo metadata (year,
genre, director, cast, studio, IMDb score) is clickable → sets the matching filter and
returns to the filtered grid (page variant only; the in-player overlay stays read-only
so a stray click can't stop playback). i18n en/hu/de.
2026-07-05 23:45:55 +02:00
|
|
|
|
api.plexBrowse({
|
|
|
|
|
|
library,
|
|
|
|
|
|
q: dq || undefined,
|
|
|
|
|
|
sort,
|
|
|
|
|
|
show,
|
|
|
|
|
|
filters,
|
|
|
|
|
|
offset: pageParam as number,
|
|
|
|
|
|
limit: PAGE,
|
|
|
|
|
|
}),
|
2026-07-05 02:32:00 +02:00
|
|
|
|
getNextPageParam: (last) => {
|
|
|
|
|
|
const seen = last.offset + last.items.length;
|
|
|
|
|
|
return seen < last.total ? seen : undefined;
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const items = browseQ.data?.pages.flatMap((p) => p.items) ?? [];
|
|
|
|
|
|
const total = browseQ.data?.pages[0]?.total ?? 0;
|
|
|
|
|
|
|
2026-07-06 00:56:01 +02:00
|
|
|
|
// Cast/crew whose name matches the current search → virtual cards above the grid; clicking one
|
|
|
|
|
|
// adds that person to the filter. Only meaningful for movie libraries (the endpoint returns [] else).
|
|
|
|
|
|
const peopleQ = useQuery({
|
|
|
|
|
|
queryKey: ["plex-people", library, dq],
|
|
|
|
|
|
queryFn: () => api.plexPeople(library, dq),
|
|
|
|
|
|
enabled: !!library && dq.length >= 2 && sub.view.kind === "grid",
|
|
|
|
|
|
});
|
|
|
|
|
|
const people = peopleQ.data?.people ?? [];
|
|
|
|
|
|
function addPerson(p: PlexPerson) {
|
|
|
|
|
|
const key = p.kind === "director" ? "directors" : "actors";
|
|
|
|
|
|
const cur = filters[key];
|
|
|
|
|
|
if (!cur.includes(p.name)) setFilters({ ...filters, [key]: [...cur, p.name] });
|
|
|
|
|
|
onClearSearch(); // switch from the name search to the person filter (clears the search box)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-07-05 03:29:20 +02:00
|
|
|
|
// Infinite scroll: auto-load the next page when the sentinel scrolls into view.
|
|
|
|
|
|
const sentinel = useRef<HTMLDivElement>(null);
|
|
|
|
|
|
const { hasNextPage, isFetchingNextPage, fetchNextPage } = browseQ;
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
const el = sentinel.current;
|
|
|
|
|
|
if (!el) return;
|
|
|
|
|
|
const io = new IntersectionObserver(
|
|
|
|
|
|
(entries) => {
|
|
|
|
|
|
if (entries[0].isIntersecting && hasNextPage && !isFetchingNextPage) fetchNextPage();
|
|
|
|
|
|
},
|
|
|
|
|
|
{ rootMargin: "600px" },
|
|
|
|
|
|
);
|
|
|
|
|
|
io.observe(el);
|
|
|
|
|
|
return () => io.disconnect();
|
|
|
|
|
|
}, [hasNextPage, isFetchingNextPage, fetchNextPage]);
|
|
|
|
|
|
|
2026-07-05 02:32:00 +02:00
|
|
|
|
function onCard(card: PlexCard) {
|
2026-07-05 21:27:02 +02:00
|
|
|
|
scrollRef.current = scroller()?.scrollTop ?? 0; // remember grid position for the trip back
|
feat(plex): P2 player — rich full-page HLS/direct player + watch-state
- backend: GET /api/plex/item/{rk} detail (metadata, cast + intro/credit markers
from Plex, episode prev/next, per-user resume+status); POST /item/{rk}/progress
(resume checkpoint, near-end→watched) + /state (new|watched|hidden).
- frontend PlexPlayer.tsx (lazy, pulls hls.js): full-page player over the Plex
module. Direct files stream raw <video>; remux via hls.js on the seek-restart
session — custom controls map the ABSOLUTE timeline over the session offset, and a
seek beyond the loaded region restarts the session at the target. Play/pause/resume
/restart, ±10s seek, prev/next episode (Shift+←/→), volume, windowed/fullscreen,
full keyboard, Skip intro/Skip credits from markers (shaded on the seekbar),
auto-advance + watched-on-end, resume from saved position, 10s progress checkpoints.
- PlexBrowse: card/episode click opens the player as a history subview (browser Back
returns to the grid/show). api client (plexItem/plexSession/plexProgress/plexSetState)
+ types; plex.player.* i18n en/hu/de. hls.js@^1.6.16.
- Verified over HTTP: detail w/ markers+cast+episode-nav, progress persist. Video
playback itself is pending browser UAT. Subtitle/audio track SELECTION deferred.
2026-07-05 04:28:00 +02:00
|
|
|
|
if (card.type === "show") sub.open({ kind: "show", id: card.id });
|
|
|
|
|
|
else sub.open({ kind: "player", id: card.id });
|
2026-07-05 02:32:00 +02:00
|
|
|
|
}
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
function onInfo(card: PlexCard) {
|
|
|
|
|
|
scrollRef.current = scroller()?.scrollTop ?? 0;
|
2026-07-06 06:50:03 +02:00
|
|
|
|
infoScrollRef.current = 0; // fresh info page starts at the top
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
sub.open({ kind: "info", id: card.id });
|
|
|
|
|
|
}
|
2026-07-05 05:26:16 +02:00
|
|
|
|
async function toggleWatched(card: PlexCard) {
|
|
|
|
|
|
await api.plexSetState(card.id, card.status === "watched" ? "new" : "watched");
|
|
|
|
|
|
qc.invalidateQueries({ queryKey: ["plex-browse"] });
|
|
|
|
|
|
}
|
2026-07-05 02:32:00 +02:00
|
|
|
|
|
feat(plex): P2 player — rich full-page HLS/direct player + watch-state
- backend: GET /api/plex/item/{rk} detail (metadata, cast + intro/credit markers
from Plex, episode prev/next, per-user resume+status); POST /item/{rk}/progress
(resume checkpoint, near-end→watched) + /state (new|watched|hidden).
- frontend PlexPlayer.tsx (lazy, pulls hls.js): full-page player over the Plex
module. Direct files stream raw <video>; remux via hls.js on the seek-restart
session — custom controls map the ABSOLUTE timeline over the session offset, and a
seek beyond the loaded region restarts the session at the target. Play/pause/resume
/restart, ±10s seek, prev/next episode (Shift+←/→), volume, windowed/fullscreen,
full keyboard, Skip intro/Skip credits from markers (shaded on the seekbar),
auto-advance + watched-on-end, resume from saved position, 10s progress checkpoints.
- PlexBrowse: card/episode click opens the player as a history subview (browser Back
returns to the grid/show). api client (plexItem/plexSession/plexProgress/plexSetState)
+ types; plex.player.* i18n en/hu/de. hls.js@^1.6.16.
- Verified over HTTP: detail w/ markers+cast+episode-nav, progress persist. Video
playback itself is pending browser UAT. Subtitle/audio track SELECTION deferred.
2026-07-05 04:28:00 +02:00
|
|
|
|
if (sub.view.kind === "player") {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<Suspense fallback={<div className="fixed inset-0 z-50 bg-black" />}>
|
feat(plex): Playlists Phase 1 — per-user ordered watch-lists (Siftlode-native)
Personal ordered lists of Plex items, kept in Siftlode's own DB (works for users
without a Plex account, like watch-state) — the "your own lists" counterpart to
shared collections. Plex-direction sync is a later phase (plex_rating_key
reserved).
Backend: migration 0048 (plex_playlists + plex_playlist_items with position),
PlexPlaylist/PlexPlaylistItem models, and per-user CRUD endpoints under
/api/plex/playlists (list [+?contains for the add dialog], create [seeded],
detail [ordered cards], rename, delete, add/remove item, reorder). _leaf_card
handles the movie/episode mix. Frontend: "Add to playlist" dialog from the movie
info page (all users), a Playlists section in PlexSidebar (list + create),
PlexPlaylistView (reorder up/down, remove, rename, delete, Play all), and
PlexPlayer gained an optional `queue` so play-through follows the list order
(prev/next + auto-advance). i18n en/hu/de. Verified end-to-end on localdev
(backend CRUD + the create→add→view→play-through UI flow).
2026-07-06 19:05:12 +02:00
|
|
|
|
<PlexPlayer itemId={sub.view.id} queue={sub.view.queue} onClose={sub.back} />
|
|
|
|
|
|
</Suspense>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (sub.view.kind === "playlist") {
|
|
|
|
|
|
const pid = sub.view.id;
|
|
|
|
|
|
return (
|
|
|
|
|
|
<Suspense fallback={<p className="p-8 text-muted text-sm">{t("plex.loading")}</p>}>
|
|
|
|
|
|
<PlexPlaylistView
|
|
|
|
|
|
playlistId={pid}
|
|
|
|
|
|
onBack={sub.back}
|
|
|
|
|
|
onPlay={(itemRk, queue) => sub.open({ kind: "player", id: itemRk, queue })}
|
|
|
|
|
|
/>
|
feat(plex): P2 player — rich full-page HLS/direct player + watch-state
- backend: GET /api/plex/item/{rk} detail (metadata, cast + intro/credit markers
from Plex, episode prev/next, per-user resume+status); POST /item/{rk}/progress
(resume checkpoint, near-end→watched) + /state (new|watched|hidden).
- frontend PlexPlayer.tsx (lazy, pulls hls.js): full-page player over the Plex
module. Direct files stream raw <video>; remux via hls.js on the seek-restart
session — custom controls map the ABSOLUTE timeline over the session offset, and a
seek beyond the loaded region restarts the session at the target. Play/pause/resume
/restart, ±10s seek, prev/next episode (Shift+←/→), volume, windowed/fullscreen,
full keyboard, Skip intro/Skip credits from markers (shaded on the seekbar),
auto-advance + watched-on-end, resume from saved position, 10s progress checkpoints.
- PlexBrowse: card/episode click opens the player as a history subview (browser Back
returns to the grid/show). api client (plexItem/plexSession/plexProgress/plexSetState)
+ types; plex.player.* i18n en/hu/de. hls.js@^1.6.16.
- Verified over HTTP: detail w/ markers+cast+episode-nav, progress persist. Video
playback itself is pending browser UAT. Subtitle/audio track SELECTION deferred.
2026-07-05 04:28:00 +02:00
|
|
|
|
</Suspense>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
if (sub.view.kind === "info") {
|
|
|
|
|
|
const infoId = sub.view.id;
|
|
|
|
|
|
return (
|
|
|
|
|
|
<PlexInfoView
|
|
|
|
|
|
id={infoId}
|
2026-07-06 17:33:16 +02:00
|
|
|
|
library={library}
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
onBack={sub.back}
|
|
|
|
|
|
onPlay={() => sub.open({ kind: "player", id: infoId })}
|
2026-07-06 02:25:48 +02:00
|
|
|
|
onPlayItem={(id) => sub.open({ kind: "player", id })}
|
feat(plex): expanded metadata filters, clickable info page, image disk cache
Backend (migration 0045_plex_filter_meta): plex_items gains rating (audienceRating
~IMDb), content_rating, studio, originally_available_at, and GIN-indexed genres /
directors / cast_names — all mirrored from the cheap section listing (no per-item API
calls; they also seed a future watch-habit recommender). /browse gains genre / content-
rating / year / rating / duration / added-within / director / actor / studio filters
(@> containment, GIN) + sort by year|rating|duration|release; new /facets endpoint
returns available genres+ratings (with counts) and the year/rating/duration bounds. A
thin on-disk image cache (.plex-img-cache) serves posters/art/cast photos from local
disk after first fetch (~7-14x faster repeat loads).
Frontend: PlexSidebar grows the full filter set (facet-driven genre/age chips, rating
steps, year range inputs, duration buckets, added-within, active people/studio chips,
clear-all); filters persist per-account as one JSON blob. PlexInfo metadata (year,
genre, director, cast, studio, IMDb score) is clickable → sets the matching filter and
returns to the filtered grid (page variant only; the in-player overlay stays read-only
so a stray click can't stop playback). i18n en/hu/de.
2026-07-05 23:45:55 +02:00
|
|
|
|
onFilter={(patch) => {
|
2026-07-06 00:15:31 +02:00
|
|
|
|
// Clicking a metadata chip sets that filter and shows the filtered grid. Array filters
|
|
|
|
|
|
// (genres/people/studios) UNION with what's already set (so you can stack people); scalars
|
|
|
|
|
|
// replace. We push a fresh grid entry (not history.back) so browser Back returns to this
|
|
|
|
|
|
// info page instead of leaving the Plex module.
|
|
|
|
|
|
const merged = { ...filters } as unknown as Record<string, unknown>;
|
|
|
|
|
|
for (const [k, v] of Object.entries(patch)) {
|
|
|
|
|
|
const cur = merged[k];
|
|
|
|
|
|
if (Array.isArray(v) && Array.isArray(cur)) {
|
|
|
|
|
|
merged[k] = Array.from(new Set([...(cur as unknown[]), ...(v as unknown[])]));
|
|
|
|
|
|
} else {
|
|
|
|
|
|
merged[k] = v;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
setFilters(merged as unknown as PlexFilters);
|
2026-07-06 06:50:03 +02:00
|
|
|
|
infoScrollRef.current = scroller()?.scrollTop ?? 0; // restore on Back to this info page
|
2026-07-06 00:15:31 +02:00
|
|
|
|
sub.open({ kind: "grid" });
|
feat(plex): expanded metadata filters, clickable info page, image disk cache
Backend (migration 0045_plex_filter_meta): plex_items gains rating (audienceRating
~IMDb), content_rating, studio, originally_available_at, and GIN-indexed genres /
directors / cast_names — all mirrored from the cheap section listing (no per-item API
calls; they also seed a future watch-habit recommender). /browse gains genre / content-
rating / year / rating / duration / added-within / director / actor / studio filters
(@> containment, GIN) + sort by year|rating|duration|release; new /facets endpoint
returns available genres+ratings (with counts) and the year/rating/duration bounds. A
thin on-disk image cache (.plex-img-cache) serves posters/art/cast photos from local
disk after first fetch (~7-14x faster repeat loads).
Frontend: PlexSidebar grows the full filter set (facet-driven genre/age chips, rating
steps, year range inputs, duration buckets, added-within, active people/studio chips,
clear-all); filters persist per-account as one JSON blob. PlexInfo metadata (year,
genre, director, cast, studio, IMDb score) is clickable → sets the matching filter and
returns to the filtered grid (page variant only; the in-player overlay stays read-only
so a stray click can't stop playback). i18n en/hu/de.
2026-07-05 23:45:55 +02:00
|
|
|
|
}}
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
/>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
feat(plex): P2 player — rich full-page HLS/direct player + watch-state
- backend: GET /api/plex/item/{rk} detail (metadata, cast + intro/credit markers
from Plex, episode prev/next, per-user resume+status); POST /item/{rk}/progress
(resume checkpoint, near-end→watched) + /state (new|watched|hidden).
- frontend PlexPlayer.tsx (lazy, pulls hls.js): full-page player over the Plex
module. Direct files stream raw <video>; remux via hls.js on the seek-restart
session — custom controls map the ABSOLUTE timeline over the session offset, and a
seek beyond the loaded region restarts the session at the target. Play/pause/resume
/restart, ±10s seek, prev/next episode (Shift+←/→), volume, windowed/fullscreen,
full keyboard, Skip intro/Skip credits from markers (shaded on the seekbar),
auto-advance + watched-on-end, resume from saved position, 10s progress checkpoints.
- PlexBrowse: card/episode click opens the player as a history subview (browser Back
returns to the grid/show). api client (plexItem/plexSession/plexProgress/plexSetState)
+ types; plex.player.* i18n en/hu/de. hls.js@^1.6.16.
- Verified over HTTP: detail w/ markers+cast+episode-nav, progress persist. Video
playback itself is pending browser UAT. Subtitle/audio track SELECTION deferred.
2026-07-05 04:28:00 +02:00
|
|
|
|
if (sub.view.kind === "show") {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<PlexShowView
|
|
|
|
|
|
showId={sub.view.id}
|
|
|
|
|
|
onBack={sub.back}
|
|
|
|
|
|
onPlay={(ep) => sub.open({ kind: "player", id: ep.id })}
|
|
|
|
|
|
/>
|
|
|
|
|
|
);
|
2026-07-05 02:32:00 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<div className="p-4 max-w-[1600px] mx-auto">
|
|
|
|
|
|
<p className="text-xs text-muted mb-3">
|
2026-07-05 03:29:20 +02:00
|
|
|
|
{browseQ.isLoading ? " " : dq ? t("plex.searchCount", { count: total }) : t("plex.count", { count: total })}
|
2026-07-05 02:32:00 +02:00
|
|
|
|
</p>
|
|
|
|
|
|
|
2026-07-06 00:56:01 +02:00
|
|
|
|
{/* Virtual person cards for a name search — click to add them to the filter. */}
|
|
|
|
|
|
{people.length > 0 && (
|
|
|
|
|
|
<div className="mb-4">
|
|
|
|
|
|
<p className="text-[11px] uppercase tracking-wide text-muted mb-2">{t("plex.people.match")}</p>
|
|
|
|
|
|
<div className="flex flex-wrap gap-2">
|
|
|
|
|
|
{people.map((p) => {
|
|
|
|
|
|
const added = (p.kind === "director" ? filters.directors : filters.actors).includes(p.name);
|
|
|
|
|
|
return (
|
|
|
|
|
|
<button
|
|
|
|
|
|
key={`${p.kind}:${p.name}`}
|
|
|
|
|
|
onClick={() => addPerson(p)}
|
|
|
|
|
|
disabled={added}
|
|
|
|
|
|
className={`flex items-center gap-2.5 rounded-xl border p-1.5 pr-3 text-left transition ${
|
|
|
|
|
|
added ? "border-accent bg-accent/10" : "border-border bg-card hover:border-accent"
|
|
|
|
|
|
}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
<div className="h-11 w-11 shrink-0 overflow-hidden rounded-full border border-border bg-surface">
|
|
|
|
|
|
{p.photo ? (
|
|
|
|
|
|
<img src={p.photo} alt="" className="h-full w-full object-cover" />
|
|
|
|
|
|
) : (
|
|
|
|
|
|
<div className="grid h-full w-full place-items-center text-sm opacity-40">
|
|
|
|
|
|
{p.name.charAt(0)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div className="min-w-0">
|
|
|
|
|
|
<div className="truncate text-sm font-medium">{p.name}</div>
|
|
|
|
|
|
<div className="text-xs text-muted">
|
|
|
|
|
|
{t(`plex.people.${p.kind}`)} · {t("plex.people.count", { count: p.count })}
|
|
|
|
|
|
{added ? ` · ${t("plex.people.added")}` : ""}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
);
|
|
|
|
|
|
})}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
2026-07-05 02:32:00 +02:00
|
|
|
|
{browseQ.isLoading ? (
|
|
|
|
|
|
<p className="text-muted text-sm">{t("plex.loading")}</p>
|
|
|
|
|
|
) : items.length === 0 ? (
|
2026-07-05 03:29:20 +02:00
|
|
|
|
<p className="text-muted text-sm">{dq ? t("plex.noMatches") : t("plex.empty")}</p>
|
2026-07-05 02:32:00 +02:00
|
|
|
|
) : (
|
|
|
|
|
|
<div className="grid grid-cols-[repeat(auto-fill,minmax(150px,1fr))] gap-3">
|
|
|
|
|
|
{items.map((c) => (
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
<PlexPosterCard
|
|
|
|
|
|
key={c.id}
|
|
|
|
|
|
card={c}
|
|
|
|
|
|
onOpen={() => onCard(c)}
|
|
|
|
|
|
onInfo={() => onInfo(c)}
|
|
|
|
|
|
onToggleWatched={toggleWatched}
|
|
|
|
|
|
/>
|
2026-07-05 02:32:00 +02:00
|
|
|
|
))}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
2026-07-05 03:29:20 +02:00
|
|
|
|
<div ref={sentinel} className="h-8" />
|
|
|
|
|
|
{isFetchingNextPage && <p className="text-center text-xs text-muted pb-4">{t("plex.loading")}</p>}
|
2026-07-05 02:32:00 +02:00
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const PLAYABLE_TINT: Record<string, string> = {
|
|
|
|
|
|
direct: "bg-emerald-500",
|
|
|
|
|
|
remux: "bg-amber-500",
|
|
|
|
|
|
transcode: "bg-orange-600",
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-07-05 05:26:16 +02:00
|
|
|
|
function PlexPosterCard({
|
|
|
|
|
|
card,
|
|
|
|
|
|
onOpen,
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
onInfo,
|
2026-07-05 05:26:16 +02:00
|
|
|
|
onToggleWatched,
|
|
|
|
|
|
}: {
|
|
|
|
|
|
card: PlexCard;
|
|
|
|
|
|
onOpen: () => void;
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
onInfo: () => void;
|
2026-07-05 05:26:16 +02:00
|
|
|
|
onToggleWatched: (c: PlexCard) => void;
|
|
|
|
|
|
}) {
|
2026-07-05 02:32:00 +02:00
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
const inProgress = (card.position_seconds ?? 0) > 0 && card.status !== "watched";
|
2026-07-05 05:26:16 +02:00
|
|
|
|
const isPlayable = card.type !== "show"; // movies/episodes play; shows open the drill-down
|
2026-07-05 02:32:00 +02:00
|
|
|
|
const pct =
|
|
|
|
|
|
inProgress && card.duration_seconds
|
|
|
|
|
|
? Math.min(100, Math.round(((card.position_seconds ?? 0) / card.duration_seconds) * 100))
|
|
|
|
|
|
: 0;
|
|
|
|
|
|
return (
|
2026-07-05 05:26:16 +02:00
|
|
|
|
<div
|
2026-07-05 03:29:20 +02:00
|
|
|
|
className="group text-left"
|
|
|
|
|
|
// content-visibility keeps off-screen posters cheap to render (smoother long-list scroll).
|
|
|
|
|
|
style={{ contentVisibility: "auto", containIntrinsicSize: "auto 300px" } as CSSProperties}
|
|
|
|
|
|
>
|
2026-07-05 05:26:16 +02:00
|
|
|
|
<div
|
|
|
|
|
|
onClick={onOpen}
|
|
|
|
|
|
role="button"
|
|
|
|
|
|
tabIndex={0}
|
|
|
|
|
|
onKeyDown={(e) => {
|
|
|
|
|
|
if (e.key === "Enter" || e.key === " ") {
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
onOpen();
|
|
|
|
|
|
}
|
|
|
|
|
|
}}
|
|
|
|
|
|
className="relative aspect-[2/3] rounded-xl overflow-hidden bg-card border border-border cursor-pointer"
|
|
|
|
|
|
>
|
2026-07-05 02:32:00 +02:00
|
|
|
|
<img
|
|
|
|
|
|
src={card.thumb}
|
|
|
|
|
|
alt=""
|
|
|
|
|
|
loading="lazy"
|
2026-07-05 03:29:20 +02:00
|
|
|
|
decoding="async"
|
2026-07-05 02:32:00 +02:00
|
|
|
|
className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-200"
|
|
|
|
|
|
/>
|
2026-07-05 05:26:16 +02:00
|
|
|
|
{/* Hover affordance: what a click does (play / resume / open show). */}
|
|
|
|
|
|
<div className="absolute inset-0 bg-black/45 opacity-0 group-hover:opacity-100 transition grid place-items-center">
|
|
|
|
|
|
{isPlayable ? (
|
|
|
|
|
|
<div className="flex flex-col items-center gap-1 text-white">
|
|
|
|
|
|
<Play className="w-10 h-10" fill="currentColor" />
|
|
|
|
|
|
<span className="text-xs font-medium">{inProgress ? t("plex.resume") : t("plex.play")}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
) : (
|
|
|
|
|
|
<span className="text-white text-xs font-medium">{t("plex.openShow")}</span>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{/* Quick watched toggle (movies/episodes), on hover. */}
|
|
|
|
|
|
{isPlayable && (
|
|
|
|
|
|
<button
|
|
|
|
|
|
onClick={(e) => {
|
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
onToggleWatched(card);
|
|
|
|
|
|
}}
|
|
|
|
|
|
title={card.status === "watched" ? t("plex.markUnwatched") : t("plex.markWatched")}
|
|
|
|
|
|
className="absolute top-1.5 right-1.5 p-1 rounded-full bg-black/60 opacity-0 group-hover:opacity-100 hover:bg-black/80 transition"
|
|
|
|
|
|
>
|
|
|
|
|
|
<CheckCircle2 className={`w-4 h-4 ${card.status === "watched" ? "text-emerald-400" : "text-white"}`} />
|
|
|
|
|
|
</button>
|
|
|
|
|
|
)}
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
{/* Media info page (movies/episodes). */}
|
|
|
|
|
|
{isPlayable && (
|
|
|
|
|
|
<button
|
|
|
|
|
|
onClick={(e) => {
|
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
onInfo();
|
|
|
|
|
|
}}
|
|
|
|
|
|
title={t("plex.info.title")}
|
|
|
|
|
|
className="absolute bottom-1.5 left-1.5 p-1 rounded-full bg-black/60 opacity-0 group-hover:opacity-100 hover:bg-black/80 transition"
|
|
|
|
|
|
>
|
|
|
|
|
|
<Info className="w-4 h-4 text-white" />
|
|
|
|
|
|
</button>
|
|
|
|
|
|
)}
|
2026-07-05 05:26:16 +02:00
|
|
|
|
{/* Watched badge when not hovering (the toggle replaces it on hover). */}
|
2026-07-05 02:32:00 +02:00
|
|
|
|
{card.status === "watched" && (
|
2026-07-05 05:26:16 +02:00
|
|
|
|
<span className="absolute top-1.5 right-1.5 text-[10px] bg-black/70 text-white px-1.5 py-0.5 rounded group-hover:opacity-0">
|
2026-07-05 02:32:00 +02:00
|
|
|
|
{t("plex.watched")}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
)}
|
|
|
|
|
|
{card.type === "show" && card.season_count != null && (
|
|
|
|
|
|
<span className="absolute bottom-1.5 left-1.5 text-[10px] bg-black/70 text-white px-1.5 py-0.5 rounded">
|
|
|
|
|
|
{t("plex.seasons", { count: card.season_count })}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
)}
|
|
|
|
|
|
{card.playable && (
|
|
|
|
|
|
<span
|
|
|
|
|
|
className={`absolute top-1.5 left-1.5 w-2 h-2 rounded-full ${PLAYABLE_TINT[card.playable] ?? "bg-gray-400"}`}
|
|
|
|
|
|
title={t(`plex.playable.${card.playable}`)}
|
|
|
|
|
|
/>
|
|
|
|
|
|
)}
|
|
|
|
|
|
{pct > 0 && (
|
|
|
|
|
|
<div className="absolute bottom-0 inset-x-0 h-1 bg-black/40">
|
|
|
|
|
|
<div className="h-full bg-accent" style={{ width: `${pct}%` }} />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div className="mt-1.5 text-sm font-medium line-clamp-2 leading-tight">{card.title}</div>
|
2026-07-05 03:29:20 +02:00
|
|
|
|
<div className="text-xs text-muted">{[card.year, dur(card.duration_seconds)].filter(Boolean).join(" · ")}</div>
|
2026-07-05 05:26:16 +02:00
|
|
|
|
</div>
|
2026-07-05 02:32:00 +02:00
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
function PlexInfoView({
|
|
|
|
|
|
id,
|
2026-07-06 17:33:16 +02:00
|
|
|
|
library,
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
onBack,
|
|
|
|
|
|
onPlay,
|
2026-07-06 02:25:48 +02:00
|
|
|
|
onPlayItem,
|
feat(plex): expanded metadata filters, clickable info page, image disk cache
Backend (migration 0045_plex_filter_meta): plex_items gains rating (audienceRating
~IMDb), content_rating, studio, originally_available_at, and GIN-indexed genres /
directors / cast_names — all mirrored from the cheap section listing (no per-item API
calls; they also seed a future watch-habit recommender). /browse gains genre / content-
rating / year / rating / duration / added-within / director / actor / studio filters
(@> containment, GIN) + sort by year|rating|duration|release; new /facets endpoint
returns available genres+ratings (with counts) and the year/rating/duration bounds. A
thin on-disk image cache (.plex-img-cache) serves posters/art/cast photos from local
disk after first fetch (~7-14x faster repeat loads).
Frontend: PlexSidebar grows the full filter set (facet-driven genre/age chips, rating
steps, year range inputs, duration buckets, added-within, active people/studio chips,
clear-all); filters persist per-account as one JSON blob. PlexInfo metadata (year,
genre, director, cast, studio, IMDb score) is clickable → sets the matching filter and
returns to the filtered grid (page variant only; the in-player overlay stays read-only
so a stray click can't stop playback). i18n en/hu/de.
2026-07-05 23:45:55 +02:00
|
|
|
|
onFilter,
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
}: {
|
|
|
|
|
|
id: string;
|
2026-07-06 17:33:16 +02:00
|
|
|
|
library: string;
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
onBack: () => void;
|
|
|
|
|
|
onPlay: () => void;
|
2026-07-06 02:25:48 +02:00
|
|
|
|
onPlayItem: (id: string) => void;
|
feat(plex): expanded metadata filters, clickable info page, image disk cache
Backend (migration 0045_plex_filter_meta): plex_items gains rating (audienceRating
~IMDb), content_rating, studio, originally_available_at, and GIN-indexed genres /
directors / cast_names — all mirrored from the cheap section listing (no per-item API
calls; they also seed a future watch-habit recommender). /browse gains genre / content-
rating / year / rating / duration / added-within / director / actor / studio filters
(@> containment, GIN) + sort by year|rating|duration|release; new /facets endpoint
returns available genres+ratings (with counts) and the year/rating/duration bounds. A
thin on-disk image cache (.plex-img-cache) serves posters/art/cast photos from local
disk after first fetch (~7-14x faster repeat loads).
Frontend: PlexSidebar grows the full filter set (facet-driven genre/age chips, rating
steps, year range inputs, duration buckets, added-within, active people/studio chips,
clear-all); filters persist per-account as one JSON blob. PlexInfo metadata (year,
genre, director, cast, studio, IMDb score) is clickable → sets the matching filter and
returns to the filtered grid (page variant only; the in-player overlay stays read-only
so a stray click can't stop playback). i18n en/hu/de.
2026-07-05 23:45:55 +02:00
|
|
|
|
onFilter: (patch: Partial<PlexFilters>) => void;
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
}) {
|
|
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
const q = useQuery({ queryKey: ["plex-item", id], queryFn: () => api.plexItem(id) });
|
|
|
|
|
|
return (
|
2026-07-06 06:50:03 +02:00
|
|
|
|
<div className="w-[90%] max-w-[1600px] mx-auto">
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
<div className="p-4 pb-0">
|
|
|
|
|
|
<button
|
|
|
|
|
|
onClick={onBack}
|
|
|
|
|
|
className="glass-card glass-hover inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs"
|
|
|
|
|
|
>
|
|
|
|
|
|
<ArrowLeft className="w-4 h-4" />
|
|
|
|
|
|
{t("plex.backToLibrary")}
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{q.isLoading || !q.data ? (
|
|
|
|
|
|
<p className="p-8 text-muted text-sm">{t("plex.loading")}</p>
|
|
|
|
|
|
) : (
|
|
|
|
|
|
<Suspense fallback={<p className="p-8 text-muted text-sm">{t("plex.loading")}</p>}>
|
2026-07-06 02:25:48 +02:00
|
|
|
|
<PlexInfo
|
|
|
|
|
|
detail={q.data}
|
|
|
|
|
|
variant="page"
|
2026-07-06 17:33:16 +02:00
|
|
|
|
library={library}
|
2026-07-06 02:25:48 +02:00
|
|
|
|
onPlay={onPlay}
|
|
|
|
|
|
onPlayItem={onPlayItem}
|
|
|
|
|
|
onFilter={onFilter}
|
2026-07-06 17:33:16 +02:00
|
|
|
|
onStateChange={() => q.refetch()}
|
2026-07-06 02:25:48 +02:00
|
|
|
|
/>
|
feat(plex): rich media info — info page, in-player info overlay, IMDb + cast photos
Backend (no migration): item_detail now also returns IMDb score + id/url (from the
Plex Rating/Guid arrays), content rating, genres, director(s), studio, tagline, and
cast as {name, role, photo}. New host-whitelisted /person-image proxy serves cast
photos from Plex's public metadata CDN (keeps third-party requests off the browser).
Frontend: reusable PlexInfo component in two forms — a full info page opened from a
card's 'i' button (history subview, art backdrop, Play/Resume + watch controls) and a
lean overlay in the player toggled with 'I' (video keeps playing). Two per-user view
prefs (faint backdrop, cast row) persisted in preferences. Mark-unwatched / clear-resume
cover the watched-reset gap. i18n en/hu/de.
2026-07-05 22:57:18 +02:00
|
|
|
|
</Suspense>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-07-05 02:32:00 +02:00
|
|
|
|
function PlexShowView({
|
|
|
|
|
|
showId,
|
|
|
|
|
|
onBack,
|
|
|
|
|
|
onPlay,
|
|
|
|
|
|
}: {
|
|
|
|
|
|
showId: string;
|
|
|
|
|
|
onBack: () => void;
|
|
|
|
|
|
onPlay: (c: PlexCard) => void;
|
|
|
|
|
|
}) {
|
|
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
const q = useQuery({ queryKey: ["plex-show", showId], queryFn: () => api.plexShow(showId) });
|
|
|
|
|
|
const d = q.data;
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<div className="p-4 max-w-[1200px] mx-auto">
|
2026-07-05 03:29:20 +02:00
|
|
|
|
<button
|
|
|
|
|
|
onClick={onBack}
|
|
|
|
|
|
className="glass-card glass-hover inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs mb-4"
|
|
|
|
|
|
>
|
|
|
|
|
|
<ArrowLeft className="w-4 h-4" />
|
|
|
|
|
|
{t("plex.backToLibrary")}
|
|
|
|
|
|
</button>
|
2026-07-05 02:32:00 +02:00
|
|
|
|
|
|
|
|
|
|
{q.isLoading || !d ? (
|
|
|
|
|
|
<p className="text-muted text-sm">{t("plex.loading")}</p>
|
|
|
|
|
|
) : (
|
|
|
|
|
|
<>
|
|
|
|
|
|
<div className="flex gap-4 mb-6">
|
|
|
|
|
|
<img
|
|
|
|
|
|
src={d.show.thumb}
|
|
|
|
|
|
alt=""
|
|
|
|
|
|
className="w-32 sm:w-40 aspect-[2/3] object-cover rounded-xl border border-border shrink-0"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<div className="min-w-0">
|
|
|
|
|
|
<h1 className="text-xl font-semibold">{d.show.title}</h1>
|
|
|
|
|
|
{d.show.year && <p className="text-sm text-muted">{d.show.year}</p>}
|
|
|
|
|
|
{d.show.summary && (
|
|
|
|
|
|
<p className="text-sm text-muted mt-2 line-clamp-6 leading-relaxed">{d.show.summary}</p>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{d.seasons.map((se) => (
|
|
|
|
|
|
<div key={se.id} className="mb-6">
|
|
|
|
|
|
<h2 className="text-sm font-semibold mb-2">{se.title}</h2>
|
|
|
|
|
|
<div className="flex flex-col divide-y divide-border/60">
|
|
|
|
|
|
{se.episodes.map((ep) => {
|
|
|
|
|
|
const inProgress = (ep.position_seconds ?? 0) > 0 && ep.status !== "watched";
|
|
|
|
|
|
return (
|
|
|
|
|
|
<button
|
|
|
|
|
|
key={ep.id}
|
|
|
|
|
|
onClick={() => onPlay(ep)}
|
|
|
|
|
|
className="flex items-center gap-3 py-2 text-left group"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div className="relative w-28 aspect-video rounded-lg overflow-hidden bg-card border border-border shrink-0">
|
|
|
|
|
|
<img src={ep.thumb} alt="" loading="lazy" className="w-full h-full object-cover" />
|
|
|
|
|
|
{ep.status === "watched" && (
|
|
|
|
|
|
<span className="absolute top-1 right-1 text-[9px] bg-black/70 text-white px-1 rounded">
|
|
|
|
|
|
✓
|
|
|
|
|
|
</span>
|
|
|
|
|
|
)}
|
|
|
|
|
|
{inProgress && <div className="absolute bottom-0 inset-x-0 h-0.5 bg-accent" />}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div className="min-w-0 flex-1">
|
|
|
|
|
|
<div className="text-sm font-medium truncate">
|
|
|
|
|
|
<span className="text-muted mr-1.5">{ep.episode_number}.</span>
|
|
|
|
|
|
{ep.title}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{ep.summary && (
|
|
|
|
|
|
<div className="text-xs text-muted line-clamp-2 mt-0.5">{ep.summary}</div>
|
|
|
|
|
|
)}
|
2026-07-05 03:29:20 +02:00
|
|
|
|
<div className="text-[11px] text-muted mt-0.5">{dur(ep.duration_seconds)}</div>
|
2026-07-05 02:32:00 +02:00
|
|
|
|
</div>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
);
|
|
|
|
|
|
})}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
))}
|
|
|
|
|
|
</>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|