Show poster thumbnails in the detail panes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
+13
-4
@@ -19,6 +19,7 @@ type result interface {
|
||||
details() string
|
||||
inLibrary() bool
|
||||
withID(id int) result // copy flagged as added to the library
|
||||
cover() coverRef
|
||||
}
|
||||
|
||||
// monitorMode is a Sonarr-style "which episodes to monitor" choice.
|
||||
@@ -50,13 +51,17 @@ type backend interface {
|
||||
|
||||
// --- Radarr ---
|
||||
|
||||
type movieResult struct{ radarr.Movie }
|
||||
type movieResult struct {
|
||||
radarr.Movie
|
||||
poster coverRef
|
||||
}
|
||||
|
||||
func (m movieResult) key() string { return radarr.TMDBTerm(m.TMDBID) }
|
||||
func (m movieResult) title() string { return m.Title }
|
||||
func (m movieResult) label() string { return movieLabel(m.Movie) }
|
||||
func (m movieResult) details() string { return movieDetails(m.Movie) }
|
||||
func (m movieResult) inLibrary() bool { return m.InLibrary() }
|
||||
func (m movieResult) cover() coverRef { return m.poster }
|
||||
func (m movieResult) withID(id int) result {
|
||||
m.ID = id
|
||||
return m
|
||||
@@ -73,7 +78,7 @@ func (b radarrBackend) search(ctx context.Context, term string) ([]result, error
|
||||
movies, err := b.c.Lookup(ctx, term)
|
||||
out := make([]result, len(movies))
|
||||
for i, m := range movies {
|
||||
out[i] = movieResult{m}
|
||||
out[i] = movieResult{Movie: m, poster: coverFor(b.c.Client, m.Images, m.InLibrary())}
|
||||
}
|
||||
return out, err
|
||||
}
|
||||
@@ -97,13 +102,17 @@ func (b radarrBackend) interactive(v *searchView, r result) {
|
||||
|
||||
// --- Sonarr ---
|
||||
|
||||
type seriesResult struct{ sonarr.Series }
|
||||
type seriesResult struct {
|
||||
sonarr.Series
|
||||
poster coverRef
|
||||
}
|
||||
|
||||
func (s seriesResult) key() string { return "tvdb:" + itoa(s.TVDBID) }
|
||||
func (s seriesResult) title() string { return s.Title }
|
||||
func (s seriesResult) label() string { return seriesLabel(s.Series) }
|
||||
func (s seriesResult) details() string { return seriesDetails(s.Series) }
|
||||
func (s seriesResult) inLibrary() bool { return s.InLibrary() }
|
||||
func (s seriesResult) cover() coverRef { return s.poster }
|
||||
func (s seriesResult) withID(id int) result {
|
||||
s.ID = id
|
||||
return s
|
||||
@@ -130,7 +139,7 @@ func (b sonarrBackend) search(ctx context.Context, term string) ([]result, error
|
||||
series, err := b.c.Lookup(ctx, term)
|
||||
out := make([]result, len(series))
|
||||
for i, s := range series {
|
||||
out[i] = seriesResult{s}
|
||||
out[i] = seriesResult{Series: s, poster: coverFor(b.c.Client, s.Images, s.InLibrary())}
|
||||
}
|
||||
return out, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user