diff --git a/ReadOpt.py b/ReadOpt.py index 5b3266a..7d1cae4 100644 --- a/ReadOpt.py +++ b/ReadOpt.py @@ -1,5 +1,7 @@ import xml.etree.ElementTree as ET +PLUS = "+" +EMPTY = "" def parse_music_xml(file_path): # 解析 XML 文件 @@ -36,7 +38,7 @@ def parse_music_xml(file_path): note_infos.append({ "designer": designer, "level": f"{level}.{level_decimal}", - "levelshow": f"{level}{"+" if level_decimal > "6" else ""}", + "levelshow": f"{level}{PLUS if int(level_decimal) > 6 else EMPTY}", }) return music_name, artist_name, note_infos diff --git a/pv_decode.py b/pv_decode.py index f4cca63..3758805 100644 --- a/pv_decode.py +++ b/pv_decode.py @@ -24,7 +24,7 @@ def dat_to_mp4(dat_file: str): """ 将 .dat 文件当作 .usm 文件处理,提取并转换为 .mp4 """ dat_path = Path(dat_file).resolve() base_name = dat_path.stem - work_dir = dat_path.parent / "work" + work_dir = dat_path.parent / "work" / "pv" usm_path = work_dir / f"{base_name}.dat" # 直接将 .dat 文件当作 .usm ivf_path = work_dir / "output" / f"{base_name}.dat" / "videos" / f"{base_name}.ivf"