Files
qbz/crates/qbz-source
vicrodh ffb35085c9 feat(source): each source interprets its own raw artwork token
Design 02 §9 stage 4 needs the art index to carry an ArtRef instead of a
String, and the producers of that index are the row mappers, which hold
no MediaRef — the windowed grid pipeline is keyed by art_key (§3.4). The
two ways to give them one were both bad: sniff the string later (that is
`artwork_qt::classify`, i.e. bug 3), or claim per visible row and let
the source look the token up again, which for Plex is one plex_cache.db
query per row on a cold grid — on the exact grid whose scroll cost is
the open perf item.

`Source::artwork_token` is the artwork analogue of `claim`: the source
says what its OWN token means, at the moment provenance is still known.
It is pure — no network, no DB, no filesystem — because the token is the
whole input.

This is what makes stage 5 free. `classify` recognises a Plex thumb only
because somebody bolted `local_plex::is_thumb_path` onto it, so a
Jellyfin token (`/Items/<id>/Images/Primary`) reads as a filesystem path
— it starts with `/` — and the pipeline opens it from disk: blank cover,
no error, nowhere to look. Dispatching by owner removes the guess.

Three impls, each carrying the arm of `classify` that was really about
it: Local (file:// and absolute paths, plus the CDN url an offline row
can keep), Plex (the two declared thumb prefixes, Unavailable rather
than None when there are no credentials), Qobuz (CDN url, cache_key on
the RAW url so downscaling does not re-download per size class).

An unregistered source returns None, not Unavailable: a row whose source
word this build does not know has no art to wait for, and Unavailable
would park it in the retry-when-connected bucket forever.

59/59.

cc
2026-08-20 01:35:47 -06:00
..