Studio images are in scope after all, and StudiosImageProvider is not written #157
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
StudiosImageProvideris the last in-box provider nothing here answers for.#105 carried one correction of its own, and landing it opened this:
MILESTONES.md(M11) used to rule studio images out as a plugin, and they are not one.
MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.csis compiledinto the server like the rest of that directory, so the fixture's four studio
thumbnails are something a stock upstream produces and a stock port has to.
It is unlike every other provider on that list in one way worth knowing before
starting: what it fetches from is a remote repository of logos — a flat list of
names in a git repository, matched against the studio's name — rather than a
metadata database keyed by an id. There is no search, no rate limit and no API
key.
Where to start
MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs. Theprovider fetches a manifest of available names once and then asks for the two
pictures a studio can have, so what is recorded in the cassette is that manifest
plus one request per studio the fixture holds.
The consumer already exists: a studio is a by-name row, and
crates/jellyfin-app/src/scan/by_name.rsstands one up for every studio a filmnames.
How to know it is done
The four studio thumbnails in the fixture are ours rather than a difference the
harness reports, compared on bytes the way every other picture in this project
is — and
crates/jellyfin-harness/README.md's ignore list loses whatever entrycovers them.
House rules
CLAUDE.mdis the short version and these are the parts that bite: tests rununder
cargo nextest; upstream's source is the checkout inupstream/at thepin (
v12.0-rc5,6d501ba4) and not the clone beside the repository;generated files are regenerated rather than edited; a comment says what the code
does, not how it got there; and
Dnreferences stay out of code and comments.The reference pair is
cargo xtask reference up, a run iscargo run -p jellyfin-harness -- replay ..., and every ignore entry carries areason and an expiry.
Closed by
1efcc2a.crates/ephyra-app/src/metadata/artwork.rsis the port ofStudiosImageProvider: it fetches{repository}/thumbs.txtonce per pass, folds a studio's name past the six characters a directory is not named with, and offers{repository}/images/{name}/thumb.jpgas aThumbfor a name the list holds. The list is not valid UTF-8 and is decoded lossily, which is what upstream'sStreamReaderdoes with it.studio_artwork_repositoryin[metadata]points it elsewhere; empty asks the repository upstream's own plugin points at.It runs where upstream's
StudiosPostScanTaskruns it — over the studio rows the pass created and no others, which isStudiosValidator's own!existingStudioIds.Contains(item.Id). So a studio the repository holds nothing for is asked about once rather than on every scan. The picture is written to the studio's own directory aslandscape.jpg;keeps_its_picturesnow files aStudiowhere it files aPersonrather than in the shard an item's pictures hash to.The fixture. The enriched library names fifteen studios and upstream saved a logo for ten of them. The pair now carries all fifteen —
enriched.jsongrew astudioskey, and the recording grew the list plus the ten pictures, laid over with the very files upstream downloaded.crates/ephyra-app/tests/studios.rsholds the port to all of it: which ten are offered a logo and which five are not, the bytes of each of the ten, that the list is asked for once however many studios there are, and where the file lands.One thing the issue asked for that is not there. No harness run exercises this either, and none can as things stand: the
defaultfixture both servers replay against registers its libraries with every fetcher off, so no film in it is filed under a studio and/Studiosreports nothing on both sides. There was no ignore-list entry covering studio pictures to retire — the only mention was a line incrates/ephyra-harness/README.mdnaming them among the known differences, and that line now says what is true instead. A pair run over studio logos wants a library provisioned with fetchers on, which is the same thing #148 and #117 need.