mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 01:45:28 +00:00
[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:
parent
56d439ed2d
commit
1841da51f0
|
@ -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...')
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue