mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-07 19:03:23 +03:00
Suits: Always set 'id' to None
Better to get a `None` value than a KeyError.
This commit is contained in:
parent
d27075cb38
commit
7b76e327ce
12
monitor.py
12
monitor.py
@ -1013,11 +1013,11 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
|||||||
# { "timestamp":"2021-04-29T09:03:37Z", "event":"BuySuit", "Name":"UtilitySuit_Class1",
|
# { "timestamp":"2021-04-29T09:03:37Z", "event":"BuySuit", "Name":"UtilitySuit_Class1",
|
||||||
# "Name_Localised":"Maverick Suit", "Price":150000, "SuitID":1698364934364699 }
|
# "Name_Localised":"Maverick Suit", "Price":150000, "SuitID":1698364934364699 }
|
||||||
new_suit = {
|
new_suit = {
|
||||||
'name': entry['Name'],
|
'name': entry['Name'],
|
||||||
'locName': entry.get('Name_Localised', entry['Name']),
|
'locName': entry.get('Name_Localised', entry['Name']),
|
||||||
# 'id': ???, # Is this an FDev ID for suit type ?
|
'id': None, # Is this an FDev ID for suit type ?
|
||||||
'suitId': entry['SuitID'],
|
'suitId': entry['SuitID'],
|
||||||
'slots': [],
|
'slots': [],
|
||||||
}
|
}
|
||||||
if self.state['Suits'] is None:
|
if self.state['Suits'] is None:
|
||||||
self.state['Suits'] = {entry['SuitID']: new_suit}
|
self.state['Suits'] = {entry['SuitID']: new_suit}
|
||||||
@ -1698,7 +1698,7 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
|||||||
|
|
||||||
slots[s] = {
|
slots[s] = {
|
||||||
'name': loadout_slots[s]['ModuleName'],
|
'name': loadout_slots[s]['ModuleName'],
|
||||||
# 'id': None, # FDevID ?
|
'id': None, # FDevID ?
|
||||||
'weaponrackId': loadout_slots[s]['SuitModuleID'],
|
'weaponrackId': loadout_slots[s]['SuitModuleID'],
|
||||||
'locName': loadout_slots[s].get('ModuleName_Localised', loadout_slots[s]['ModuleName']),
|
'locName': loadout_slots[s].get('ModuleName_Localised', loadout_slots[s]['ModuleName']),
|
||||||
'locDescription': '',
|
'locDescription': '',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user