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

Re-allow commodities in "salvage" category.

This commit is contained in:
Jonathan Harris 2015-06-06 01:08:04 +01:00
parent 4bdaee1932
commit 753e5ad951
2 changed files with 4 additions and 5 deletions

View File

@ -23,8 +23,7 @@ holdoff = 120 # be nice
categorymap = { 'Narcotics': 'Legal Drugs',
'Slaves': 'Slavery',
'NonMarketable': False,
'Salvage': False, }
'NonMarketable': False, }
commoditymap= { 'Agricultural Medicines': 'Agri-Medicines',
'Atmospheric Extractors': 'Atmospheric Processors',

View File

@ -24,7 +24,7 @@ def export(data, callback):
'uploaderID': data['commander']['name'].strip() }
systemName = data['lastSystem']['name'].strip()
stationName = data['lastStarport']['name'].strip()
timestamp = time.strftime('%Y-%m-%dT%H:%M:%S', time.gmtime(querytime))
timestamp = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime(querytime))
# route all requests through a session in the hope of using keep-alive
session = requests.Session()
@ -43,9 +43,9 @@ def export(data, callback):
'stationName': stationName,
'itemName': commoditymap.get(commodity['name'].strip(), commodity['name'].strip()),
'buyPrice': int(commodity.get('buyPrice', 0)),
'stationStock': commodity.get('stockBracket') and int(commodity.get('stock', 0)),
'stationStock': commodity.get('stockBracket') and int(commodity.get('stock', 0)) or 0,
'sellPrice': int(commodity.get('sellPrice', 0)),
'demand': commodity.get('demandBracket') and int(commodity.get('demand', 0)),
'demand': commodity.get('demandBracket') and int(commodity.get('demand', 0)) or 0,
'timestamp': timestamp,
}
}