🚑️ Fix namecard parse

This commit is contained in:
xtaodada 2023-04-12 11:23:16 +08:00
parent 2d9e63ff98
commit 154b5fd243
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -65,10 +65,10 @@ async def update_metadata_from_github(overwrite: bool = True):
started = False started = False
cell = [] cell = []
async for line in response.aiter_lines(): async for line in response.aiter_lines():
if line == " {\n": if line == " {\n":
started = True started = True
continue continue
if line in [" },\n", " }\n"]: if line in [" },\n", " }\n"]:
started = False started = False
if any("MATERIAL_NAMECARD" in x for x in cell): if any("MATERIAL_NAMECARD" in x for x in cell):
material_json_data.append(json.loads("{" + "".join(cell) + "}")) material_json_data.append(json.loads("{" + "".join(cell) + "}"))