From 9e7c1a0660f1ec3259e119ac75f804b56318acf3 Mon Sep 17 00:00:00 2001 From: sctop <2094880085@qq.com> Date: Tue, 4 Jun 2024 01:56:11 +0800 Subject: [PATCH] fix: StoryPartAuto bugfix --- data | 2 +- data_model/actual_data/_story/story_part_auto.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/data b/data index 8105eda..70c7827 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit 8105eda5d107fc7395d6c87a5bc0eddfb386b66e +Subproject commit 70c782779db25f1bbe8820185c0c08a4c2543af4 diff --git a/data_model/actual_data/_story/story_part_auto.py b/data_model/actual_data/_story/story_part_auto.py index 58ec4ac..e47bb77 100644 --- a/data_model/actual_data/_story/story_part_auto.py +++ b/data_model/actual_data/_story/story_part_auto.py @@ -67,7 +67,8 @@ def __init__(self, data, story): self.data_special = { "flag": self.data["special"]["flag"], "track": None if self.data["special"]["track"] == "OST_0" else TrackInfo.get_instance( - self.data["special"]["track"]) + self.data["special"]["track"]), + "char": [] if "char" not in self.data["special"].keys() else self.data["special"]["char"] } def load(self): @@ -209,4 +210,7 @@ def to_json_basic_tracks(self): # traceback: # File "F:\GitFile\BA_OST_Index_Parser\data_model\actual_data\story.py", line 355, in to_json # t["bgm_special"] = self.part.to_json_basic_tracks() - return [self.data_special["track"].to_json_basic()] + try: + return [self.data_special["track"].to_json_basic()] + except Exception: + return []