mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-14 08:17:13 +03:00
Fix 2.4 cAPI queries
This commit is contained in:
parent
c491659ef0
commit
a90c1e982a
@ -514,7 +514,7 @@ class AppWindow:
|
||||
self.eddn.export_outfitting(data, monitor.is_beta)
|
||||
if data['lastStarport'].get('ships'):
|
||||
self.eddn.export_shipyard(data, monitor.is_beta)
|
||||
elif data['lastStarport']['services'].get('shipyard'):
|
||||
elif data['lastStarport'].get('services', {}).get('shipyard'):
|
||||
# API is flakey about shipyard info - silently retry if missing (<1s is usually sufficient - 5s for margin).
|
||||
self.w.after(int(SERVER_RETRY * 1000), lambda:self.retry_for_shipyard(2))
|
||||
if not old_status:
|
||||
|
@ -245,15 +245,16 @@ class Session:
|
||||
|
||||
def station(self):
|
||||
data = self.query(URL_QUERY)
|
||||
if data.get('docked'):
|
||||
if data['lastStarport']['services'].get('commodities'):
|
||||
if data['commander'].get('docked'):
|
||||
services = data['lastStarport'].get('services', {})
|
||||
if services.get('commodities'):
|
||||
marketdata = self.query(URL_MARKET)
|
||||
if (data['lastStarport']['name'] != marketdata['name'] or
|
||||
int(data['lastStarport']['id']) != int(marketdata['id'])):
|
||||
raise ServerLagging()
|
||||
else:
|
||||
data['lastStarport'].update(marketdata)
|
||||
if data['lastStarport']['services'].get('outfitting') or data['lastStarport']['services'].get('shipyard'):
|
||||
if services.get('outfitting') or services.get('shipyard'):
|
||||
shipdata = self.query(URL_SHIPYARD)
|
||||
if (data['lastStarport']['name'] != shipdata['name'] or
|
||||
int(data['lastStarport']['id']) != int(shipdata['id'])):
|
||||
|
Loading…
x
Reference in New Issue
Block a user