Posters: fetch TheMovieDB images at the shown size, not the original
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,23 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestTMDBSized(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
in string
|
||||
large bool
|
||||
want string
|
||||
}{
|
||||
{"https://image.tmdb.org/t/p/original/abc.jpg", true, "https://image.tmdb.org/t/p/w780/abc.jpg"},
|
||||
{"https://image.tmdb.org/t/p/original/abc.jpg", false, "https://image.tmdb.org/t/p/w342/abc.jpg"},
|
||||
{"https://image.tmdb.org/t/p/w500/abc.jpg", true, "https://image.tmdb.org/t/p/w500/abc.jpg"},
|
||||
{"https://artworks.thetvdb.com/banners/posters/1.jpg", true, "https://artworks.thetvdb.com/banners/posters/1.jpg"},
|
||||
} {
|
||||
if got := tmdbSized(tc.in, tc.large); got != tc.want {
|
||||
t.Errorf("tmdbSized(%q, %v) = %q, want %q", tc.in, tc.large, got, tc.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestScaledVariant(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
in string
|
||||
|
||||
Reference in New Issue
Block a user