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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user