1
0
mirror of synced 2024-11-12 01:20:47 +01:00

Fix yubiosi 1.5 and 2.0 loader not liking a trailing empty line

This commit is contained in:
Stepland 2024-07-15 02:18:42 +02:00
parent 4aea1a36dc
commit ea0cbb0979

View File

@ -94,7 +94,7 @@ def load_yubiosi_1_5_file(lines: list[str]) -> song.Song:
title = tags.get("TITLE_NAME")
timing = load_timing_data_1_5(tags)
notes = [load_1_5_note(line) for line in note_lines]
notes = [load_1_5_note(line) for line in note_lines if line.strip()]
level = Decimal(tags.get("LEVEL", 0))
audio = tags.get("AUDIO_FILE")
@ -290,6 +290,8 @@ def iter_yubiosi_2_0_notes(lines: list[str]) -> Iterator[song.TapNote]:
for i, line in enumerate(lines, start=1):
if line.startswith("//"):
continue
elif not line.strip():
continue
else:
try:
yield load_1_5_note(line)