mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 01:00:18 +02:00
Bulk fill-only refresh passes fill_only on to each app and title
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
47266afe85
commit
1b5f540a66
3 files changed
+21
-2
No files matched your search
@@ -108,6 +108,25 @@ class EntryPoints(unittest.TestCase):
|
|||||||
self.assertTrue(all(c.kwargs == {'fill_only': True} for c in refresh.call_args_list))
|
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)
|
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):
|
def test_upgrade_leaves_legacy_customised_titles_alone(self):
|
||||||
# A title installed before art_pending existed, whose art the user has customised in Steam.
|
# 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'],
|
legacy = [{'id':'Game','settings':{'compat_tool':'proton-experimental'},'argv':['game.exe'],
|
||||||
|
|||||||
+1
-1
@@ -287,7 +287,7 @@ def refresh_art(pkg=None, artwork=None, fill_only=False):
|
|||||||
results = []
|
results = []
|
||||||
for app in list_apps():
|
for app in list_apps():
|
||||||
try:
|
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
|
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__})
|
results.append({'package': app['package'], 'label': app.get('label'), 'error': str(e) or type(e).__name__})
|
||||||
return results
|
return results
|
||||||
|
|||||||
+1
-1
@@ -780,7 +780,7 @@ def refresh_art(gid=None, artwork=None, fill_only=False):
|
|||||||
if not t['frame_control']:
|
if not t['frame_control']:
|
||||||
continue
|
continue
|
||||||
try:
|
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
|
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__})
|
results.append({'id': t['id'], 'name': t['name'], 'error': str(e) or type(e).__name__})
|
||||||
return results
|
return results
|
||||||
|
|||||||
Reference in new issue
Block a user