1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 17:42:20 +03:00

Inara: Update to use ShipLocker, possibly from file.

This commit is contained in:
Athanasius 2021-06-10 12:52:15 +01:00
parent 3ea0bcce5e
commit 9fa02b51c3

View File

@ -1098,7 +1098,14 @@ def journal_entry( # noqa: C901, CCR001
new_add_event('addCommanderTravelLand', entry['timestamp'], to_send_data)
elif event_name == 'ShipLockerMaterials':
elif event_name == 'ShipLocker':
# In ED 4.0.0.400 the event is only full sometimes, other times indicating
# ShipLocker.json was written.
if not all([entry.get(t, False) for t in ('Components', 'Consumables', 'Data', 'Items')]):
# So it's an empty event, core EDMC should have stuffed the data
# into state['ShipLockerJSON'].
entry = state['ShipLockerJSON']
odyssey_plural_microresource_types = ('Items', 'Components', 'Data', 'Consumables')
# we're getting new data here. so reset it on inara's side just to be sure that we set everything right
reset_data = [{'itemType': t} for t in odyssey_plural_microresource_types]