Detail panes: poster top right, title and facts left, plot below; sextant rendering
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -32,6 +32,12 @@ type UI struct {
|
||||
// Posters of titles that are not in the library yet are downloaded from
|
||||
// the public image hosts Radarr/Sonarr point to (TMDb, TheTVDB).
|
||||
Covers *bool `json:"covers,omitempty"`
|
||||
// CoverStyle selects the block characters posters are drawn with:
|
||||
// "quadrant" (2x2 pixels per cell, every font has the glyphs), "sextant"
|
||||
// (2x3, sharper, needs a font with the Symbols for Legacy Computing
|
||||
// block, e.g. kitty, WezTerm, foot, Ghostty) or "auto" (default: sextant
|
||||
// on terminals known to draw them, quadrant elsewhere).
|
||||
CoverStyle string `json:"cover_style,omitempty"`
|
||||
}
|
||||
|
||||
// ShowCovers reports whether poster thumbnails are enabled.
|
||||
@@ -146,5 +152,10 @@ func (c *Config) Validate() error {
|
||||
errs = append(errs, fmt.Errorf("%s: url %q must be an http(s) URL", s.name, s.svc.URL))
|
||||
}
|
||||
}
|
||||
switch c.UI.CoverStyle {
|
||||
case "", "auto", "quadrant", "sextant":
|
||||
default:
|
||||
errs = append(errs, fmt.Errorf(`ui.cover_style: %q must be "auto", "quadrant" or "sextant"`, c.UI.CoverStyle))
|
||||
}
|
||||
return errors.Join(errs...)
|
||||
}
|
||||
|
||||
@@ -97,3 +97,15 @@ func TestShowCovers(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCoverStyleValidation(t *testing.T) {
|
||||
base := `{"radarr":{"url":"http://r","apikey":"k"},"sonarr":{"url":"http://s","apikey":"k"},"sabnzbd":{"url":"http://a","apikey":"k"},"ui":{"cover_style":`
|
||||
for _, ok := range []string{`"auto"`, `"quadrant"`, `"sextant"`, `""`} {
|
||||
if _, err := Parse([]byte(base + ok + `}}`)); err != nil {
|
||||
t.Errorf("%s rejected: %v", ok, err)
|
||||
}
|
||||
}
|
||||
if _, err := Parse([]byte(base + `"braille"}}`)); err == nil {
|
||||
t.Error("unknown style accepted")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user