From c5aab07d65827801d8a9ad934e895499232b1583 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sat, 1 Sep 2018 18:12:16 -0400 Subject: [PATCH] Make sure small abyssal nos has a type name (bad eve data) --- scripts/jsonToSql.py | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/scripts/jsonToSql.py b/scripts/jsonToSql.py index 2d1b3ed01..add0fe957 100755 --- a/scripts/jsonToSql.py +++ b/scripts/jsonToSql.py @@ -72,33 +72,33 @@ def main(db, json_path): fieldMapping = { 'dgmattribs': { - 'displayName_en-us': 'displayName' + 'displayName': 'displayName' }, 'dgmeffects': { - 'displayName_en-us': 'displayName', - 'description_en-us': 'description' + 'displayName': 'displayName', + 'description': 'description' }, 'dgmunits': { - 'displayName_en-us': 'displayName' + 'displayName': 'displayName' }, #icons??? 'evecategories': { - 'categoryName_en-us': 'categoryName' + 'categoryName': 'categoryName' }, 'evegroups': { - 'groupName_en-us': 'groupName' + 'groupName': 'groupName' }, 'invmetagroups': { - 'metaGroupName_en-us': 'metaGroupName' + 'metaGroupName': 'metaGroupName' }, 'evetypes': { - 'typeName_en-us': 'typeName', - 'description_en-us': 'description' + 'typeName': 'typeName', + 'description': 'description' }, #phbtraits??? 'mapbulk_marketGroups': { - 'marketGroupName_en-us': 'marketGroupName', - 'description_en-us': 'description' + 'marketGroupName': 'marketGroupName', + 'description': 'description' } } @@ -163,7 +163,7 @@ def main(db, json_path): for row in data: typeLines = [] typeId = row['typeID'] - traitData = row['traits_en-us'] + traitData = row['traits'] for skillData in sorted(traitData.get('skills', ()), key=lambda i: i['header']): typeLines.append(convertSection(skillData)) if 'role' in traitData: @@ -198,7 +198,7 @@ def main(db, json_path): for row in data['evetypes']: if (row['published'] or row['groupID'] == 1306 # group Ship Modifiers, for items like tactical t3 ship modes - or row['typeName_en-us'].startswith('Civilian') # Civilian weapons + or row['typeName'].startswith('Civilian') # Civilian weapons or row['typeID'] in (41549, 41548, 41551, 41550) # Micro Bombs (Fighters) or row['groupID'] in ( 1882, @@ -225,7 +225,7 @@ def main(db, json_path): for row in table: # We don't care about some kind of rows, filter it out if so if not isIgnored(jsonName, row): - if jsonName == 'evetypes' and row['typeName_en-us'].startswith('Civilian'): # Apparently people really want Civilian modules available + if jsonName == 'evetypes' and row['typeName'].startswith('Civilian'): # Apparently people really want Civilian modules available row['published'] = True instance = tables[jsonName]() @@ -287,6 +287,9 @@ def main(db, json_path): eos.db.gamedata_engine.execute('UPDATE invtypes SET published = 0 WHERE typeName LIKE \'%abyssal%\'') + # fix for #1722 until CCP gets their shit together + eos.db.gamedata_engine.execute('UPDATE invtypes SET typeName = \'Small Abyssal Energy Nosferatu\' WHERE typeID = ? AND typeName = ?', (48419, '')) + print() for x in CATEGORIES_TO_REMOVE: cat = eos.db.gamedata_session.query(eos.gamedata.Category).filter(eos.gamedata.Category.ID == x).first()