feat(plex): poster collages on the genre + collection browse tiles
The Browse-by-genre tiles and the Collections browse tiles were flat color-hash
gradients. Give each a 2×2 collage of its top films' poster art, with the color hash
kept as the fallback so a group with no matching art (a show-only or empty collection)
never renders blank.
Backend: a shared `top_art_keys` windowed query returns, per key (a genre value or a
collection rating_key), the top few items' rating_keys — best-rated then newest, in one
query. Wired into the Discover genre tiles and the collections union endpoint; the client
renders the posters from the existing /api/plex/image/{key} endpoint, so no new image
plumbing. Frontend: a shared PosterTile component (collage + scrim + label, color-hash
fallback) replaces the two ad-hoc colored-tile implementations.
Verified live on localdev: genre tiles and collection tiles render real poster collages,
with the color fallback correctly kicking in for groups without art.
Gate: tsc/lint/knip/prettier clean, 423 vitest; backend ruff clean, 11 discover tests
(incl. a new genre-art assertion).
This commit is contained in:
@@ -184,6 +184,7 @@ export interface PlexCollection {
|
||||
source?: string;
|
||||
editable: boolean;
|
||||
can_edit?: boolean; // effective: admin-marked editable AND a plain (non-smart/non-auto) collection
|
||||
art?: string[]; // up to 4 poster rating_keys for the browse-tile collage (browse union only)
|
||||
}
|
||||
export interface PlexPlaylist {
|
||||
id: number;
|
||||
@@ -342,7 +343,8 @@ export interface PlexDiscover {
|
||||
scope: string;
|
||||
continue_watching: PlexCard[];
|
||||
recently_added: PlexCard[];
|
||||
genres: { value: string; count: number }[]; // top genres → tap a tile to filter the grid
|
||||
// top genres → tap a tile to filter the grid; `art` = up to 4 poster rating_keys for the collage
|
||||
genres: { value: string; count: number; art: string[] }[];
|
||||
because_you_watched: { anchor: { id: string; title: string }; items: PlexCard[] } | null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user