From dc07312efa518e56e2d11b21025ca7531a864178 Mon Sep 17 00:00:00 2001 From: Philip Kendall Date: Fri, 22 Nov 2019 22:42:45 +0000 Subject: [PATCH] Better method for finding new language key. --- source/mtga/set_data/dynamic.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source/mtga/set_data/dynamic.py b/source/mtga/set_data/dynamic.py index 26fe688..7354a3b 100644 --- a/source/mtga/set_data/dynamic.py +++ b/source/mtga/set_data/dynamic.py @@ -63,11 +63,8 @@ def _get_data_location_hardcoded(): all_abilities = {} loc_map = {} - try: - en = list(filter(lambda x: x["langkey"] == "EN", loc))[0] - except: - ## langkeys are null in 11/21 patch??? - en = loc[0] + # Post 2019-11-21 patch, language is encoded in a different key + en = list(filter(lambda x: x["langkey"] == "EN" or x["isoCode"] == "en-US", loc))[0] for obj in en["keys"]: # if obj["id"] in loc_map.keys(): # print("WARNING: overwriting id {} = {} with {}".format(obj["id"], loc_map[obj["id"]], obj["text"]))