mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-21 11:27:38 +03:00
Don't try to generate a shipyard link if we have no known loadout.
This is currently the case on Odyssey Alpha Phase 1 when logging in on-foot. There's no Journal 'Loadout' event, but the CAPI update does let us know we have a Sidewinder active. But `monitor.state['Modules']` is None.
This commit is contained in:
parent
de9e8e944e
commit
a9c4c191e9
@ -1076,16 +1076,20 @@ class AppWindow(object):
|
||||
|
||||
def shipyard_url(self, shipname: str) -> str:
|
||||
"""Despatch a ship URL to the configured handler."""
|
||||
if not (loadout := monitor.ship()):
|
||||
logger.warning('No ship loadout, aborting.')
|
||||
return ''
|
||||
|
||||
if not bool(config.get_int("use_alt_shipyard_open")):
|
||||
return plug.invoke(config.get_str('shipyard_provider'),
|
||||
'EDSY',
|
||||
'shipyard_url',
|
||||
monitor.ship(),
|
||||
loadout,
|
||||
monitor.is_beta)
|
||||
|
||||
# Avoid file length limits if possible
|
||||
provider = config.get_str('shipyard_provider', default='EDSY')
|
||||
target = plug.invoke(provider, 'EDSY', 'shipyard_url', monitor.ship(), monitor.is_beta)
|
||||
target = plug.invoke(provider, 'EDSY', 'shipyard_url', loadout, monitor.is_beta)
|
||||
file_name = join(config.app_dir_path, "last_shipyard.html")
|
||||
|
||||
with open(file_name, 'w') as f:
|
||||
|
Loading…
x
Reference in New Issue
Block a user