From 37ec61a28d08be7120fcccfc19c6e9719425c865 Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Tue, 3 Apr 2018 14:41:27 +0100 Subject: [PATCH] Fix for setting Coriolis link on cAPI Update --- plugins/coriolis.py | 2 +- plugins/edsm.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/coriolis.py b/plugins/coriolis.py index c75e522d..791a3a14 100644 --- a/plugins/coriolis.py +++ b/plugins/coriolis.py @@ -37,7 +37,7 @@ def shipyard_url(loadout, is_beta, data=None): plug.show_error(_("Where are you?!")) # Shouldn't happen elif not data.get('ship', {}).get('name') or not data.get('ship', {}).get('modules'): plug.show_error(_("What are you flying?!")) # Shouldn't happen - elif (loadout['ShipID'] is not None and data['ship']['id'] != loadout['ShipID']) or (loadout['Ship'] and data['ship']['name'].lower() != loadout['Ship']): + elif (loadout.get('ShipID') is not None and data['ship']['id'] != loadout['ShipID']) or (loadout.get('Ship') and data['ship']['name'].lower() != loadout['Ship']): plug.show_error(_('Error: Frontier server is lagging')) # Raised when Companion API server is returning old data, e.g. when the servers are too busy else: string = json.dumps(companion.ship(data), ensure_ascii=False, sort_keys=True, separators=(',', ':')).encode('utf-8') # most compact representation diff --git a/plugins/edsm.py b/plugins/edsm.py index bf255d94..ec760dad 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -269,7 +269,7 @@ def cmdr_data(data, is_beta): 'event': 'Coriolis', 'timestamp': timestamp, '_shipId': data['ship']['id'], - 'url': plug.invoke('Coriolis', None, 'shipyard_url', entry, is_beta, data) + 'url': plug.invoke('Coriolis', None, 'shipyard_url', {}, is_beta, data) })) this.lastship = ship