From 1b5f540a6621c1ef96fda004e25c4c1d41d70d14 Mon Sep 17 00:00:00 2001 From: saphid <4596216+saphid@users.noreply.github.com> Date: Mon, 28 Sep 2026 23:37:42 +1000 Subject: [PATCH] Bulk fill-only refresh passes fill_only on to each app and title Co-Authored-By: Claude Opus 5.5 (1M context) --- tests/test_library_entrypoints.py | 19 +++++++++++++++++++ ui/frame_android.py | 2 +- ui/frame_titles.py | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/tests/test_library_entrypoints.py b/tests/test_library_entrypoints.py index 8671204..cb46c37 100644 --- a/tests/test_library_entrypoints.py +++ b/tests/test_library_entrypoints.py @@ -108,6 +108,25 @@ class EntryPoints(unittest.TestCase): self.assertTrue(all(c.kwargs == {'fill_only': True} for c in refresh.call_args_list)) title_refresh.assert_called_once_with('G', fill_only=True) + def test_bulk_fill_only_refresh_keeps_names_and_art(self): + meta = {**self.info, 'instance':2800000001, 'shortcut':3346865537, 'flatscreen':False} + with patch.object(android, 'list_apps', return_value=[{'package':self.info['package']}]), \ + patch.object(android, '_meta_or_fail', return_value=meta), \ + patch.object(android, 'ssh', side_effect=lambda cmd, **kw: json.dumps({'icon_png':''}) if cmd == 'python3 -' else '/home/steamos'), \ + patch.object(android, '_write_meta'): + android.refresh_art(fill_only=True) + options = json.loads(next(c.args for c in self.api.call_args_list if c.args[0] == 'configure')[8]) + self.assertTrue(options['fill_only']) + self.api.reset_mock() + with patch.object(titles, 'list_titles', return_value=[{'id':'Game','name':'Game','frame_control':True}]), \ + patch.object(titles, '_check_id', side_effect=lambda gid: gid), \ + patch.object(titles, '_library_shortcut', return_value=7), \ + patch.object(titles, 'ssh', side_effect=lambda cmd, **kw: '{"name":"Game"}' if cmd.startswith('cat devkit') + else '{"artwork":{},"icon":""}' if cmd == 'python3 -' else '/home/steamos'): + titles.refresh_art(fill_only=True) + options = json.loads(next(c.args for c in self.api.call_args_list if c.args[0] == 'configure')[8]) + self.assertTrue(options['fill_only']) + def test_upgrade_leaves_legacy_customised_titles_alone(self): # A title installed before art_pending existed, whose art the user has customised in Steam. legacy = [{'id':'Game','settings':{'compat_tool':'proton-experimental'},'argv':['game.exe'], diff --git a/ui/frame_android.py b/ui/frame_android.py index c304d03..a10cbfc 100644 --- a/ui/frame_android.py +++ b/ui/frame_android.py @@ -287,7 +287,7 @@ def refresh_art(pkg=None, artwork=None, fill_only=False): results = [] for app in list_apps(): try: - results.append(refresh_art(app['package'], artwork)) + results.append(refresh_art(app['package'], artwork, fill_only)) except Exception as e: # one app's failure must not stop the others results.append({'package': app['package'], 'label': app.get('label'), 'error': str(e) or type(e).__name__}) return results diff --git a/ui/frame_titles.py b/ui/frame_titles.py index 0acfd84..3876c3a 100644 --- a/ui/frame_titles.py +++ b/ui/frame_titles.py @@ -780,7 +780,7 @@ def refresh_art(gid=None, artwork=None, fill_only=False): if not t['frame_control']: continue try: - results.append(refresh_art(t['id'], artwork)) + results.append(refresh_art(t['id'], artwork, fill_only)) except Exception as e: # report each title; one failure doesn't stop the rest results.append({'id': t['id'], 'name': t['name'], 'error': str(e) or type(e).__name__}) return results