Skip to content

feat(season): season poster support#68

Open
PNRxA wants to merge 1 commit into
mainfrom
feat/season-posters
Open

feat(season): season poster support#68
PNRxA wants to merge 1 commit into
mainfrom
feat/season-posters

Conversation

@PNRxA

@PNRxA PNRxA commented Jun 11, 2026

Copy link
Copy Markdown
Owner

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:

GET /{api_key}/{id_type}/season-default/{id_value}    (+ /c/ CDN variant)

with a season-{show}-S{n} id for all three id types:

ID type Example
TMDB season-default/season-1396-S2.jpg
IMDb season-default/season-tt0903747-S2.jpg
TVDB season-default/season-81189-S2.jpg

The 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_path is the season poster with a series-poster fallback.

Rendering — seasons reuse the existing 2:3 poster pipeline (generate_poster). New handle_season_inner / generate_season_with_source / try_fanart_path_season / trigger_season_refresh mirror the poster handlers. A dedicated ImageType::Season (seasons/ subdir, _s cache prefix, db value s) 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 sourcesFanart.tv seasonposter (filtered by season number, with an all fallback) → 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 test0 failures (494 lib tests + all integration suites; new season tests across db_operations, query_overrides, image_size, cdn_redirects, plus id-resolution + fanart unit tests).
  • cargo build --release --features test-support — clean.
  • Frontend vitest340 passing (27 files); build-only — clean.
  • An adversarial multi-dimension review (cache-key collisions, serve pipeline, id/ratings/fanart, settings/migrations, routing/contract) confirmed 0 defects.

Follow-up (separate repo)

openposterdb-plex-provider should map Plex type 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

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant