fix(plex): every small Plex picture asks for its card-size cut

The playlist rows, the search box and the collection picker still
fetched the 400px poster for a 32-80px picture. A contract test pins the
set of bare Plex pictures, and the srcset widths to imgcache.SIZES.
This commit is contained in:
2026-10-02 23:42:32 +02:00
parent e16cdbd16f
commit a50055577a
5 changed files with 90 additions and 6 deletions
@@ -5,6 +5,7 @@ import { qk } from "../lib/queryKeys";
import { api, type PlexCard } from "../lib/api";
import { useDebounced } from "../lib/useDebounced";
import { LoadingState } from "./ui/QueryState";
import { cardImage } from "../lib/plexImage";
// A debounced library search-and-pick list, shared by the "Add title" panel (PlexCollectionView) and
// the "New collection" first-title panel (plexBrowseLists) — both search the library the same way and
@@ -49,7 +50,7 @@ export default function PlexLibraryPicker({
{results.map((c) => (
<li key={c.id} className="flex items-center gap-3">
<img
src={c.thumb}
{...cardImage(c.thumb)}
alt=""
className="h-12 w-8 shrink-0 rounded object-cover"
loading="lazy"