Skip to content

Commit 1841da5

Browse files
committed
[core/models] Support additional command line parameters from metadata
This should fix things like the fake Fortnite "games" (Lego Fortnite etc.)
1 parent 56d439e commit 1841da5

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

legendary/core.py

+7
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,13 @@ def get_launch_parameters(self, app_name: str, offline: bool = False,
733733
self.log.warning(f'Parsing predefined launch parameters failed with: {e!r}, '
734734
f'input: {install.launch_parameters}')
735735

736+
if meta_args := game.additional_command_line:
737+
try:
738+
params.game_parameters.extend(shlex.split(meta_args.strip(), posix=False))
739+
except ValueError as e:
740+
self.log.warning(f'Parsing metadata launch parameters failed with: {e!r}, '
741+
f'input: {install.launch_parameters}')
742+
736743
game_token = ''
737744
if not offline:
738745
self.log.info('Getting authentication token...')

legendary/models/game.py

+6
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ def supports_cloud_saves(self):
9191
def supports_mac_cloud_saves(self):
9292
return self.metadata and (self.metadata.get('customAttributes', {}).get('CloudSaveFolder_MAC') is not None)
9393

94+
@property
95+
def additional_command_line(self):
96+
if not self.metadata:
97+
return None
98+
return self.metadata.get('customAttributes', {}).get('AdditionalCommandLine', {}).get('value', None)
99+
94100
@property
95101
def catalog_item_id(self):
96102
if not self.metadata:

0 commit comments

Comments
 (0)