From d05bd5de8db59fc0575613d57f05ee6cf0cefd42 Mon Sep 17 00:00:00 2001 From: acutenoob Date: Mon, 27 Apr 2026 22:14:25 +0800 Subject: [PATCH 1/4] add supported for special songs --- gameInformation.py | 23 +++++++++++++++-------- phira.py | 28 ++++++++++++++++------------ resource.py | 12 ++++++++++++ 3 files changed, 43 insertions(+), 20 deletions(-) diff --git a/gameInformation.py b/gameInformation.py index fa66d99..e3fd512 100644 --- a/gameInformation.py +++ b/gameInformation.py @@ -38,16 +38,23 @@ def run(path, logger): if key == "otherSongs": continue for song in songs: - if len(song["difficulty"]) == 5: - song["difficulty"].pop() - if song["difficulty"][-1] == 0.0: - song["difficulty"].pop() - song["charter"].pop() for i in range(len(song["difficulty"])): song["difficulty"][i] = str(round(song["difficulty"][i], 1)) - song["songsId"] = song["songsId"][:-2] - difficulty.append([song["songsId"]]+song["difficulty"]) - table.append((song["songsId"], song["songsName"], song["composer"], song["illustrator"], *song["charter"])) + if song["songsName"] == "望影の方舟Six": + difficulty.append([song["songsId"]] + song["difficulty"] + ["0.0"] + song["difficulty"]) + song["charter"].append("NULL") + for i in range(0,3): + song["charter"].append(song["charter"][i]) + else: + difficulty.append([song["songsId"]] + song["difficulty"]) + if song["songsName"] == "Random": + a = [' ','R','a','n','d','o','m'] + for i in range(0,7): + song + difficulty.append([song["songsId"][:-1] + str(i)] + song["difficulty"]) + table.append((song["songsId"][:-1] + str(i), song["songsName"] + a[i], song["composer"], song["illustrator"], *song["charter"])) + else: + table.append((song["songsId"], song["songsName"], song["composer"], song["illustrator"], *song["charter"])) logger.info(difficulty) logger.info(table) diff --git a/phira.py b/phira.py index b4bfa85..ac7018d 100644 --- a/phira.py +++ b/phira.py @@ -2,7 +2,7 @@ import shutil from zipfile import ZipFile, BadZipFile -levels = ["EZ", "HD", "IN", "AT"] +levels = ["EZ", "HD", "IN", "AT","Legacy","EZ_Error","HD_Error","IN_Error","NUll"] # 删除旧目录并创建新目录 try: @@ -60,6 +60,10 @@ try: print(f"正在处理:{info['Name']},作曲者:{info['Composer']}") for level_index in range(len(info.get("difficulty", []))): + if info['Name'] == "望影の方舟Six": + print("LABEL" + str(len(info['difficulty']))) + if info['difficulty'][level_index] == "0.0": + continue level = levels[level_index] pez_path = f"phira/{level}/{id}-{level}.pez" try: @@ -68,9 +72,9 @@ info_txt_content = ( f"#\n" f"Name: {info['Name']}\n" - f"Song: {id}.ogg\n" - f"Picture: {id}.png\n" - f"Chart: {id}.json\n" + f"Song: {id[:-2]}.ogg\n" + f"Picture: {id[:-2]}.png\n" + f"Chart: {id[:-2]}.json\n" f"Level: {level} Lv.{info['difficulty'][level_index]}\n" f"Composer: {info['Composer']}\n" f"Illustrator: {info['Illustrator']}\n" @@ -80,26 +84,26 @@ # 添加文件到 .pez 压缩包 try: - pez.write(f"chart/{id}.0/{level}.json", f"{id}.json") + pez.write(f"chart/{id}/{level}.json", f"{id[:-2]}.json") except FileNotFoundError: - print(f"警告:未找到 {id} 的 {level} 图表文件 (chart/{id}.0/{level}.json)。") + print(f"警告:未找到 {id} 的 {level} 图表文件 (chart/{id}/{level}.json)。") try: - pez.write(f"IllustrationLowRes/{id}.png", f"{id}.png") + pez.write(f"illustrationLowRes/{id[:-2]}.png", f"{id[:-2]}.png") except FileNotFoundError: - print(f"警告:未找到 {id} 的插图文件 (IllustrationLowRes/{id}.png)。") + print(f"警告:未找到 {id} 的插图文件 (illustrationLowRes/{id[:-2]}.png)。") try: - pez.write(f"music/{id}.ogg", f"{id}.ogg") + pez.write(f"music/{id[:-2]}.ogg", f"{id[:-2]}.ogg") except FileNotFoundError: - print(f"警告:未找到 {id} 的音乐文件 (music/{id}.ogg)。") + print(f"警告:未找到 {id} 的音乐文件 (music/{id[:-2]}.ogg)。") except BadZipFile as e: print(f"错误:创建 .pez 文件 {pez_path} 时出错 - {e}") except Exception as e: - print(f"错误:写入 .pez 文件 {pez_path} 时出错 - {e}") + print(f"错误:写入 .pez 文件 {pez_path} 时出错2 - {e}") except KeyError as e: print(f"错误:ID {id} 缺少必要的键 {e}。") except Exception as e: - print(f"意外错误:处理 ID {id} 时发生错误 - {e}") + print(f"意外错误:处理 ID {id} 时发生错误1 - {e}") diff --git a/resource.py b/resource.py index b17d079..0fa4e93 100644 --- a/resource.py +++ b/resource.py @@ -78,6 +78,18 @@ def save(key, entry, pool, logger): if not os.path.exists(p): os.mkdir(p) queue_in.put(("chart/%s/%s.json" % (key[:-14], key[-7:-5]), obj.script)) + elif config["chart"] and key[-18:-11] == "/Chart_" and key[-5:] == ".json": + logger.info(key) + p = "chart/" + key[:-18] + if not os.path.exists(p): + os.mkdir(p) + queue_in.put(("chart/%s/%s.json" % (key[:-18], key[-11:-5]), obj.script)) + elif config["chart"] and key[-20:-13] == "/Chart_" and key[-5:] == ".json": + logger.info(key) + p = "chart/" + key[:-20] + if not os.path.exists(p): + os.mkdir(p) + queue_in.put(("chart/%s/%s.json" % (key[:-20], key[-13:-5]), obj.script)) elif config["illustrationBlur"] and key[-23:-3] == ".0/IllustrationBlur.": key = key[:-23] bytesIO = BytesIO() From 05cf5e94e02bcdc79b65c27901514e1ca571807d Mon Sep 17 00:00:00 2001 From: acutenoob <130275336+acutenoob@users.noreply.github.com> Date: Wed, 6 May 2026 10:53:53 +0800 Subject: [PATCH 2/4] remove debug --- phira.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/phira.py b/phira.py index ac7018d..d517f9a 100644 --- a/phira.py +++ b/phira.py @@ -2,7 +2,7 @@ import shutil from zipfile import ZipFile, BadZipFile -levels = ["EZ", "HD", "IN", "AT","Legacy","EZ_Error","HD_Error","IN_Error","NUll"] +levels = ["EZ", "HD", "IN", "AT","Legacy","EZ_Error","HD_Error","IN_Error"] # 删除旧目录并创建新目录 try: @@ -60,8 +60,6 @@ try: print(f"正在处理:{info['Name']},作曲者:{info['Composer']}") for level_index in range(len(info.get("difficulty", []))): - if info['Name'] == "望影の方舟Six": - print("LABEL" + str(len(info['difficulty']))) if info['difficulty'][level_index] == "0.0": continue level = levels[level_index] From 636dbf9584b79b3d873c71f06c522021d4db5374 Mon Sep 17 00:00:00 2001 From: acutenoob <130275336+acutenoob@users.noreply.github.com> Date: Wed, 6 May 2026 10:54:39 +0800 Subject: [PATCH 3/4] oh no I forget it --- phira.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phira.py b/phira.py index d517f9a..474b002 100644 --- a/phira.py +++ b/phira.py @@ -99,9 +99,9 @@ except BadZipFile as e: print(f"错误:创建 .pez 文件 {pez_path} 时出错 - {e}") except Exception as e: - print(f"错误:写入 .pez 文件 {pez_path} 时出错2 - {e}") + print(f"错误:写入 .pez 文件 {pez_path} 时出错 - {e}") except KeyError as e: print(f"错误:ID {id} 缺少必要的键 {e}。") except Exception as e: - print(f"意外错误:处理 ID {id} 时发生错误1 - {e}") + print(f"意外错误:处理 ID {id} 时发生错误 - {e}") From 06788bf06be7286e90c442085b3e21646b259bbe Mon Sep 17 00:00:00 2001 From: acutenoob <130275336+acutenoob@users.noreply.github.com> Date: Wed, 6 May 2026 11:49:24 +0800 Subject: [PATCH 4/4] show charters correctly --- gameInformation.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gameInformation.py b/gameInformation.py index e3fd512..a0bba0f 100644 --- a/gameInformation.py +++ b/gameInformation.py @@ -48,11 +48,19 @@ def run(path, logger): else: difficulty.append([song["songsId"]] + song["difficulty"]) if song["songsName"] == "Random": - a = [' ','R','a','n','d','o','m'] + a = ["","[R]","[A]","[N]","[D]","[O]","[M]"] + charters = [ + ["Barbarianerman", "IMD_6", "_鉄"], + ["Barbarianerman × V17AMax", "IMD_6 × JKy", "_鉄 × Rikko"], + ["Barbarianerman × Pcat", "IMD_6 × Ctymax", "_鉄 × NerSAN"], + ["Barbarianerman × TimiTini", "IMD_6 × Gausbon", "_鉄 × Myna"], + ["Barbarianerman × Clutter", "IMD_6 × Uvernight", "_鉄 × Su1fuR"], + ["Barbarianerman × 阿爽", "IMD_6 × 晨", "_鉄 × 百九十八"], + ["Barbarianerman × J.R", "IMD_6 × Likey", "_鉄 × XMT小咩兔"] +] for i in range(0,7): - song difficulty.append([song["songsId"][:-1] + str(i)] + song["difficulty"]) - table.append((song["songsId"][:-1] + str(i), song["songsName"] + a[i], song["composer"], song["illustrator"], *song["charter"])) + table.append((song["songsId"][:-1] + str(i), song["songsName"] + a[i], song["composer"], song["illustrator"], *charters[i])) else: table.append((song["songsId"], song["songsName"], song["composer"], song["illustrator"], *song["charter"]))