Repository navigation
Fetch show posters and episode stills from TMDB - #303
Merged
Merged
Conversation
Every episode row was a grey TV glyph. The renderer was right and the series-poster fallback was right -- nothing had ever fetched any artwork. Tvdb writes episode stills and was the only source that did, and it needs its own API key. A server holding a TMDB key and no TVDB key had nothing fetching stills at all, while Tmdb was requesting the very episode record that carries still_path and throwing the image away. The series path wrote no poster_path either, so the fallback had nothing to fall back to. Both are stored now, from responses already being fetched, so no extra API calls. Stored as full w780 URLs: TMDB returns a bare path that renders broken if kept as-is, the same trap the TVDB source documents. Nothing overwrites a cover that came with the file or one a person chose. library:show-artwork backfills existing items, since enrichment does not re-run on its own and an already-enriched episode keeps its empty cover for ever. Series first, because the episodes fall back to the poster.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The real cause of the blank episode covers. My earlier fixes — the series-poster fallback (#299) and the client payload version — were both correct and both irrelevant: nothing had ever fetched any show artwork to display.
What I found
Tvdbwrites episode stills and was the only source that did. It needs its own API key. Your server hastmdb_api_keyset andtvdb_api_keyempty, so nothing was fetching stills at all.Meanwhile
Tmdb::enrichEpisode()was requesting/tv/{id}/season/{n}/episode/{n}— the record that carriesstill_path— reading the name and air date off it, and discarding the image. The series path wrote noposter_patheither, so the fallback I added in #299 had nothing to fall back to.Both are now stored, from responses the source was already fetching. No extra API calls.
Backfill
Fixing the source only helps items enriched afterwards, and enrichment never re-runs on its own — an already-enriched episode keeps its empty cover for ever, which is every episode in the reported library.
library:show-artworkgoes back for them. Series first, deliberately: an episode with no still of its own falls back to the series poster, so fetching posters first leaves every row showing something even where TMDB has no still.--dry-runwrites nothing; no key is a hard refusal rather than a silent "filled 0 of 400".Testing
9 new tests, 206 pass across show/artwork/enrichment/metadata. Each confirmed to fail against its target:
still_pathdiscardedan_episode_gets_its_still_from_tmdb,a_bare_path_becomes_a_full_urlposter_pathdiscardeda_series_gets_its_poster_from_tmdbexisting_artwork_is_not_overwrittena_dry_run_writes_nothingit_refuses_without_a_tmdb_keyFor review
w780is a judgement call. Large enough for a detail page at 3x, small enough that a sixty-episode list is not sixty full-resolution images. If you think stills should be smaller than posters, they can take different sizes.Not verified against the real API. This machine has zero
showrows and I have no TMDB key here, so every test uses a faked response shaped like TMDB's. The shape is from their documented schema, not from a live call — worth one real run on a5 (library:show-artwork --dry-run --limit=5first) before trusting it over a large library.Order of operations matters on deploy. The backfill should run after this merges, and the phone needs its full re-fetch (SoundChexiOS#91 has the payload-version change) before the covers appear on device.