From 658e8552cbf2eeb995eb35aac9599e559645f7b1 Mon Sep 17 00:00:00 2001 From: Jose Falanga Date: Wed, 19 Aug 2026 18:29:34 -0300 Subject: [PATCH] Stop returning GIF URLs from _best_portrait_url When all available cover URLs are GIFs (coverUrl, stillCoverUrl, and screenshots), return empty instead of a GIF URL. HTTPImageFetcher cannot decode GIFs, so attempting to fetch one always returns null. Returning empty early avoids unnecessary network requests and confusing log noise. --- core/boxart_itch.gd | 9 ++++++--- plugin.json | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/boxart_itch.gd b/core/boxart_itch.gd index 136e8fc..78648e1 100644 --- a/core/boxart_itch.gd +++ b/core/boxart_itch.gd @@ -174,6 +174,7 @@ func _url_for_layout(kind: LAYOUT, cover_url: String, screenshots: Array) -> Str for url in screenshots: if not _is_gif_url(url): return url + # cover_url is already sanitized and non-GIF by the time it reaches here return cover_url LAYOUT.BANNER: # Single screenshot fallback (two-screenshot case handled in get_boxart). @@ -187,7 +188,8 @@ func _url_for_layout(kind: LAYOUT, cover_url: String, screenshots: Array) -> Str ## Returns a non-GIF URL suitable for portrait/logo from the game data. ## Falls back through: stillCoverUrl → coverUrl (non-GIF) → first non-GIF -## screenshot. +## 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 var still: String = game.get("stillCoverUrl", "") @@ -201,8 +203,9 @@ func _best_portrait_url(game: Dictionary, screenshots: Array) -> String: for url in screenshots: if not _is_gif_url(url): return url - # Last resort: use whatever we have (GIF) - return still if not still.is_empty() else cover + # All available URLs are GIFs — return empty so the caller gets null + # instead of attempting a doomed fetch. + return "" ## Combines two textures side-by-side into a single banner image. diff --git a/plugin.json b/plugin.json index 6f90dc0..25b9074 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.8", + "plugin.version": "0.1.9", "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",