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:
+26
-1
@@ -257,7 +257,32 @@ func (v *seriesView) renderDetail() {
|
||||
sum = se
|
||||
}
|
||||
}
|
||||
v.detail.Show(seriesRowDetail(v.series, r.ep, r.season, sum, v.seasonMonitored(r.season), time.Now().Format("2006-01-02")), v.cover)
|
||||
v.detail.Show(seriesRowDetail(v.series, r.ep, r.season, sum, v.seasonMonitored(r.season), time.Now().Format("2006-01-02")), v.seasonCover(r.season))
|
||||
}
|
||||
|
||||
// seasonCover is the poster of a season, for its row and its episodes: the
|
||||
// season's own poster where Sonarr has one (a TheTVDB link, fetched without
|
||||
// credentials), else, or when it cannot be loaded, the series poster.
|
||||
func (v *seriesView) seasonCover(season int) coverRef {
|
||||
for _, se := range v.series.Seasons {
|
||||
if se.SeasonNumber != season {
|
||||
continue
|
||||
}
|
||||
for _, img := range se.Images {
|
||||
if img.CoverType != "poster" || img.RemoteURL == "" {
|
||||
continue
|
||||
}
|
||||
remote, series := img.RemoteURL, v.cover
|
||||
return coverRef{key: "season|" + remote, fetch: func(ctx context.Context, large bool) ([]byte, error) {
|
||||
data, err := arr.FetchURL(ctx, remote)
|
||||
if err != nil && series.fetch != nil {
|
||||
return series.fetch(ctx, large)
|
||||
}
|
||||
return data, err
|
||||
}}
|
||||
}
|
||||
}
|
||||
return v.cover
|
||||
}
|
||||
|
||||
// seriesRowDetail is the detail text of the drill-down: the series, then the
|
||||
|
||||
Reference in New Issue
Block a user