Real-image posters: scale to the box's pixel size

Ghostty shows an image smaller than its placement at its own size, so
library posters (Radarr's poster-500 is 333x500, not 500x750) came out
smaller than the 426x640 remote ones. Images are now scaled (bilinear)
to exactly cols*cellWidth x rows*cellHeight pixels before upload, and
library titles use the original poster for real images. The disk cache
stores posters as decoded (JPEG) instead of the possibly large originals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 11:25:45 +02:00
co-authored by Claude Opus 5.5
parent 786e783951
commit 15e97f4582
8 changed files with 100 additions and 25 deletions
+2 -2
View File
@@ -24,7 +24,7 @@ func TestScaledVariant(t *testing.T) {
}
}
func TestLargePosterUsesThe500Variant(t *testing.T) {
func TestLargePosterUsesTheOriginal(t *testing.T) {
var paths []string
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
paths = append(paths, r.URL.Path)
@@ -39,7 +39,7 @@ func TestLargePosterUsesThe500Variant(t *testing.T) {
if _, err := fetch(context.Background(), false); err != nil {
t.Fatal(err)
}
if strings.Join(paths, " ") != "/MediaCover/1/poster-500.jpg /MediaCover/1/poster-250.jpg" {
if strings.Join(paths, " ") != "/MediaCover/1/poster.jpg /MediaCover/1/poster-250.jpg" {
t.Errorf("requests = %v", paths)
}
}