feat(season): season poster support#68
Open
PNRxA wants to merge 1 commit into
Open
Conversation
Add a season-default image endpoint that renders a TV season's own
poster (2:3) with rating badges, served via
/{api_key}/{id_type}/season-default/{id_value} (+ /c/ CDN variant)
using a season-{show}-S{n} id for imdb/tmdb/tvdb.
- id: MediaType::Season + SeasonInfo + season-{id}-S{n} resolvers
- cache: ImageType::Season (seasons/ subdir, _s prefix, db value s)
- ratings: season-scoped via TMDB (season vote_average) and Trakt
(season ratings); IMDb/RT/Metacritic fall back to show-level via the
show imdb id; MDBList is skipped (no season endpoint)
- art: Fanart.tv seasonposter (filtered by season number) -> TMDB
season poster -> series poster fallback
- settings: 8 dedicated season_* render settings mirroring the poster
controls (no blur/fit/split), with DB columns, migrations, and a
full Seasons admin UI
- docs: README season endpoint + OpenAPI getSeason
The Plex Custom Metadata Provider can now request season posters; a
follow-up in openposterdb-plex-provider will map Plex season items to
this endpoint.
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.
Summary
Adds season poster support — a TV season's own poster (2:3) rendered with rating badges — motivated by the Plex metadata provider, which can now request per-season art instead of falling back to the show poster.
New endpoint:
with a
season-{show}-S{n}id for all three id types:season-default/season-1396-S2.jpgseason-default/season-tt0903747-S2.jpgseason-default/season-81189-S2.jpgThe id is the series id combined with the season number (mirrors the existing
episode-{id}-S{n}E{n}convention).What's included
ID resolution (
id/mod.rs) —MediaType::Season,SeasonInfo,season-{id}-S{n}parsers + resolvers for imdb/tmdb/tvdb. Seasons carry no imdb id of their own, so the show's imdb/tvdb id is resolved for downstream ratings;poster_pathis the season poster with a series-poster fallback.Rendering — seasons reuse the existing 2:3 poster pipeline (
generate_poster). Newhandle_season_inner/generate_season_with_source/try_fanart_path_season/trigger_season_refreshmirror the poster handlers. A dedicatedImageType::Season(seasons/subdir,_scache prefix, db values) keeps caches fully isolated from series posters.Ratings — season-scoped where the source supports it: TMDB (the season's
vote_average) and Trakt (the season rating). IMDb / RT / Metacritic fall back to show-level (via the show imdb id); MDBList is skipped (no season endpoint).Art sources — Fanart.tv
seasonposter(filtered by season number, with anallfallback) → TMDB season poster → series poster. Language/textless variants work as for posters.Settings + admin UI — 8 dedicated
season_*render settings mirroring the poster controls (ratings limit, badge style/label/size/position/direction/shape/background; no blur/fit/split). New DB columns + migrations (defaults match the code defaults), per-key + global settings, free-key settings, and a full Seasons admin page (SeasonsView, settings form, sidebar nav, preview).Docs — README season endpoint section, URL templates, cache/db tables, and OpenAPI
getSeason.Testing
cargo test— 0 failures (494 lib tests + all integration suites; new season tests acrossdb_operations,query_overrides,image_size,cdn_redirects, plus id-resolution + fanart unit tests).cargo build --release --features test-support— clean.vitest— 340 passing (27 files);build-only— clean.Follow-up (separate repo)
openposterdb-plex-providershould map Plextype 3(season) items to this endpoint (Kind::Season(n)→season-{base}-S{n},season-default) instead of returning the show poster. The Jellyfin plugin could add season images similarly. No change needed in this repo.🤖 Generated with Claude Code