From f732f81ee42efb4aa1afb2e1286665a758cb6941 Mon Sep 17 00:00:00 2001 From: baiqwerdvd <158065462+baiqwerdvd@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:04:17 +0800 Subject: [PATCH] update --- pyproject.toml | 2 +- starrail_damage_cal/mono/Character.py | 5 +---- starrail_damage_cal/to_data.py | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ef73d9c..3cf90db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "starrail_damage_cal" -version = "1.9.4" +version = "1.9.5" description = "For StarRail Role Damage Cal" authors = [ {name = "qwerdvd", email = "105906879+qwerdvd@users.noreply.github.com"}, diff --git a/starrail_damage_cal/mono/Character.py b/starrail_damage_cal/mono/Character.py index ba599d3..89135c0 100644 --- a/starrail_damage_cal/mono/Character.py +++ b/starrail_damage_cal/mono/Character.py @@ -77,10 +77,7 @@ class Character: # 处理套装属性 set_id_dict = Counter(set_id_list) # logger.info(set_id_dict.most_common()) - for item in set_id_dict.most_common(): - set_property = "" - set_id = item[0] - count = item[1] + for set_id, count in set_id_dict.most_common(): set_value = 0 if count >= 2: status_add = RelicSetSkill[str(set_id)].get("2", None) diff --git a/starrail_damage_cal/to_data.py b/starrail_damage_cal/to_data.py index 3d4b902..6430a3c 100644 --- a/starrail_damage_cal/to_data.py +++ b/starrail_damage_cal/to_data.py @@ -377,8 +377,8 @@ async def get_data( path.mkdir(parents=True, exist_ok=True) path.mkdir(parents=True, exist_ok=True) with Path.open( - path / f"{char_data.avatarName}.json", "w", encoding="UTF-8" + path / f"{char_data.avatarName}.json", "wb", encoding="UTF-8" ) as file: - json.dump(char_data, file, ensure_ascii=False) + _ = file.write(msgjson.encode(char_data)) return char_data, char_data.avatarName