Series drill-down: season posters

The drill-down reads the series with includeSeasonImages=true (Sonarr
only sends season posters when asked, as TheTVDB links). A selected
season or episode shows its season's poster; without one, or when it
cannot be loaded, the series poster.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-23 23:42:49 +02:00
co-authored by Claude Opus 5.5
parent 73efe279d4
commit ca28a3c9bb
7 changed files with 92 additions and 2 deletions
+5 -1
View File
@@ -46,6 +46,9 @@ type Season struct {
SeasonNumber int `json:"seasonNumber"`
Monitored bool `json:"monitored"`
Statistics Statistics `json:"statistics"`
// Images are the season's posters, only filled by GetSeries; Sonarr keeps
// no copy of them, so they only have a remote URL (TheTVDB).
Images []arr.Image `json:"images,omitempty"`
}
// Statistics are the episode counts Sonarr reports for library series.
@@ -179,7 +182,8 @@ func (c *Client) SearchEpisode(ctx context.Context, episodeID int) error {
// GetSeries fetches one library series.
func (c *Client) GetSeries(ctx context.Context, id int) (Series, error) {
var s Series
err := c.Do(ctx, http.MethodGet, "series/"+strconv.Itoa(id), nil, nil, &s)
// Season posters are only sent when asked for.
err := c.Do(ctx, http.MethodGet, "series/"+strconv.Itoa(id), url.Values{"includeSeasonImages": {"true"}}, nil, &s)
return s, err
}