From 7a8e168ac19658ace6cf8d1bc9527c69ce43aae9 Mon Sep 17 00:00:00 2001 From: Stepland <16676308+Stepland@users.noreply.github.com> Date: Sat, 25 Jul 2020 23:33:27 +0200 Subject: [PATCH] Fix load_memo2 being unable to handle files that do not specify an offset --- CHANGELOG.md | 7 +++++++ jubeatools/formats/jubeat_analyser/memo2/load.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a9fc9c1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# v0.1.1 +## Fixed +- Loading a #memo2 file that did not specify any offset (neither by `o=...`, `r=...` nor `[...]` commands) would trigger a TypeError, not anymore ! Offset now defaults to zero. + + +# v0.1.0 +- Initial Release \ No newline at end of file diff --git a/jubeatools/formats/jubeat_analyser/memo2/load.py b/jubeatools/formats/jubeat_analyser/memo2/load.py index 037e72f..b377c0b 100644 --- a/jubeatools/formats/jubeat_analyser/memo2/load.py +++ b/jubeatools/formats/jubeat_analyser/memo2/load.py @@ -449,7 +449,7 @@ def _load_memo2_file(lines: List[str]) -> Song: metadata.preview_length = SecondsTime(10) timing = Timing( - events=parser.timing_events, beat_zero_offset=SecondsTime(parser.offset) / 1000 + events=parser.timing_events, beat_zero_offset=SecondsTime(parser.offset or 0) / 1000 ) charts = { parser.difficulty: Chart(