From 98053e6ea7ae7d6e1edc372b2e164846a8a2a51c Mon Sep 17 00:00:00 2001 From: Jose Falanga Date: Wed, 19 Aug 2026 18:49:29 -0300 Subject: [PATCH] fix: don't fall back to screenshots as capsule art _best_portrait_url was falling back to non-GIF screenshots when both coverUrl and stillCoverUrl were GIFs. Screenshots are not capsule art, so this produced wrong imagery. Now the function only returns cover URLs and returns empty when only GIFs are available. --- core/boxart_itch.gd | 18 +++++------------- plugin.json | 2 +- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/core/boxart_itch.gd b/core/boxart_itch.gd index 78648e1..0a6e9a0 100644 --- a/core/boxart_itch.gd +++ b/core/boxart_itch.gd @@ -186,25 +186,17 @@ func _url_for_layout(kind: LAYOUT, cover_url: String, screenshots: Array) -> Str return "" -## Returns a non-GIF URL suitable for portrait/logo from the game data. -## Falls back through: stillCoverUrl → coverUrl (non-GIF) → first non-GIF -## screenshot. Returns empty if only GIFs are available, since -## HTTPImageFetcher cannot decode GIF images. -func _best_portrait_url(game: Dictionary, screenshots: Array) -> String: - # Prefer stillCoverUrl if it's not a GIF +## Returns the best portrait/logo URL from the game data. +## Prefers stillCoverUrl, then coverUrl. Screenshots are never used as +## capsule art. Returns empty if the only available cover URLs are GIFs, +## since HTTPImageFetcher cannot decode GIF images. +func _best_portrait_url(game: Dictionary, _screenshots: Array) -> String: var still: String = game.get("stillCoverUrl", "") if not still.is_empty() and not _is_gif_url(still): return still - # Try coverUrl if it's not a GIF var cover: String = game.get("coverUrl", "") if not cover.is_empty() and not _is_gif_url(cover): return cover - # Try the first non-GIF screenshot - for url in screenshots: - if not _is_gif_url(url): - return url - # All available URLs are GIFs — return empty so the caller gets null - # instead of attempting a doomed fetch. return "" diff --git a/plugin.json b/plugin.json index 25b9074..634e65f 100644 --- a/plugin.json +++ b/plugin.json @@ -1,7 +1,7 @@ { "plugin.id": "itch-artprovider", "plugin.name": "itch.io Art Provider", - "plugin.version": "0.1.9", + "plugin.version": "0.1.10", "plugin.min-api-version": "1.1.0", "plugin.link": "https://forge.thergic.ar/jose/itchio-opengamepadui-artprovider-plugin", "plugin.source": "https://forge.thergic.ar/jose/itchio-opengamepadui-artprovider-plugin",