mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-05-29 14:49:29 +03:00
Filter commodities on legality
This commit is contained in:
parent
323b414e19
commit
d0cba6f4c4
@ -292,6 +292,8 @@ def fixup(data):
|
||||
else:
|
||||
if not category_map.get(commodity['categoryname'], True): # Check marketable
|
||||
pass
|
||||
elif commodity.get('legality'): # Check not prohibited
|
||||
pass
|
||||
elif not commodity.get('categoryname'):
|
||||
if __debug__: print 'Missing "categoryname" for "%s"' % commodity.get('name', '')
|
||||
elif not commodity.get('name'):
|
||||
|
3
eddn.py
3
eddn.py
@ -159,7 +159,8 @@ class EDDN:
|
||||
def export_commodities(self, data, is_beta):
|
||||
commodities = []
|
||||
for commodity in data['lastStarport'].get('commodities') or []:
|
||||
if category_map.get(commodity['categoryname'], True): # Check marketable
|
||||
if (category_map.get(commodity['categoryname'], True) and # Check marketable
|
||||
not commodity.get('legality')): # check not prohibited
|
||||
commodities.append(OrderedDict([
|
||||
('name', commodity['name']),
|
||||
('meanPrice', int(commodity['meanPrice'])),
|
||||
|
Loading…
x
Reference in New Issue
Block a user