Posters: fall back to the provider's image when the instance has no copy

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 00:17:34 +02:00
co-authored by Claude Sonnet 5.5
parent 9edd62634f
commit 706a094b20
3 changed files with 41 additions and 3 deletions
+10 -2
View File
@@ -25,7 +25,7 @@ func (c *Client) Poster(images []Image, inLibrary bool) (key string, fetch func(
continue
}
if inLibrary && img.URL != "" {
local := img.URL
local, remote := img.URL, img.RemoteURL
base, _ := c.settings()
return base + "|" + local, func(ctx context.Context) ([]byte, error) {
// MediaCover has poster-250.jpg next to poster.jpg; fall back to the original.
@@ -34,7 +34,15 @@ func (c *Client) Poster(images []Image, inLibrary bool) (key string, fetch func(
return data, nil
}
}
return c.GetBytes(ctx, local)
data, err := c.GetBytes(ctx, local)
if err != nil && remote != "" {
// The instance has not cached (or has lost) its copy: use the
// metadata provider's, as for titles that are not in the library.
if remoteData, remoteErr := FetchURL(ctx, remote); remoteErr == nil {
return remoteData, nil
}
}
return data, err
}, true
}
if img.RemoteURL != "" {