mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 04:04:21 +02:00
SteamGridDB: request PNG only for logos and icons
The live API rejects mimes=image/jpeg on /logos and /icons, so every logo and icon lookup fell back to generated art. Found with a real key: SuperTux now gets grid, wide, hero and logo; Beat Saber all five. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
d18f1655be
commit
2c8e2fb2a8
2 files changed
+7
-1
No files matched your search
@@ -329,6 +329,10 @@ class SteamGridDB(unittest.TestCase):
|
||||
self.assertEqual(set(images),set(artwork.SLOTS));self.assertEqual(warnings,[])
|
||||
self.assertTrue(all(url.endswith('/top.png') for url in images.values()))
|
||||
self.assertTrue(all('/game/2?' in p for p in calls[1:]))
|
||||
# SteamGridDB rejects JPEG in logo/icon queries (the live API returned an error for SuperTux).
|
||||
for p in calls[1:]:
|
||||
jpeg = 'image%2Fjpeg' in p
|
||||
self.assertEqual(jpeg, p.startswith(('/grids/', '/heroes/')), p)
|
||||
|
||||
def test_unicode_titles_match_exactly_and_symbols_never_match_all(self):
|
||||
self.assertEqual(sgdb._name('ビートセイバー VR!'), 'ビートセイバーvr')
|
||||
|
||||
@@ -84,7 +84,9 @@ def lookup(name, deadline=None):
|
||||
for slot, kind, dimensions in [('grid', 'grids', '600x900'), ('wide', 'grids', '920x430'),
|
||||
('hero', 'heroes', ''), ('logo', 'logos', ''), ('icon', 'icons', '')]:
|
||||
try:
|
||||
query = {'types': 'static', 'nsfw': 'false', 'humor': 'false', 'mimes': 'image/png,image/jpeg'}
|
||||
# Logos and icons only come as PNG (or WebP/ICO); asking for JPEG there is rejected outright.
|
||||
mimes = 'image/png,image/jpeg' if kind in ('grids', 'heroes') else 'image/png'
|
||||
query = {'types': 'static', 'nsfw': 'false', 'humor': 'false', 'mimes': mimes}
|
||||
if dimensions:
|
||||
query['dimensions'] = dimensions
|
||||
records = _get('/' + kind + '/game/' + str(gid) + '?' + urllib.parse.urlencode(query), key, deadline)
|
||||
|
||||
Reference in new issue
Block a user