[core/models] Support additional command line parameters from metadata

This should fix things like the fake Fortnite "games" (Lego Fortnite etc.)
This commit is contained in:
derrod 2023-12-13 23:15:08 +01:00
parent 56d439ed2d
commit 1841da51f0
2 changed files with 13 additions and 0 deletions

View file

@ -733,6 +733,13 @@ class LegendaryCore:
self.log.warning(f'Parsing predefined launch parameters failed with: {e!r}, '
f'input: {install.launch_parameters}')
if meta_args := game.additional_command_line:
try:
params.game_parameters.extend(shlex.split(meta_args.strip(), posix=False))
except ValueError as e:
self.log.warning(f'Parsing metadata launch parameters failed with: {e!r}, '
f'input: {install.launch_parameters}')
game_token = ''
if not offline:
self.log.info('Getting authentication token...')

View file

@ -91,6 +91,12 @@ class Game:
def supports_mac_cloud_saves(self):
return self.metadata and (self.metadata.get('customAttributes', {}).get('CloudSaveFolder_MAC') is not None)
@property
def additional_command_line(self):
if not self.metadata:
return None
return self.metadata.get('customAttributes', {}).get('AdditionalCommandLine', {}).get('value', None)
@property
def catalog_item_id(self):
if not self.metadata: