Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when metadata fields have numbers in them (e.g. NOTESDESIGNER0) #61

Merged
merged 2 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tja2fumen/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def split_tja_lines_into_courses(lines: list[str]) -> TJASong:
current_course_basename = ''
for line in lines:
# Only metadata and #START commands are relevant for this function
match_metadata = re.match(r"^([A-Z]+):(.*)", line)
match_metadata = re.match(r"^([A-Z0-9]+):(.*)", line)
match_start = re.match(r"^#START(?:\s+(.+))?", line)

# Case 1: Metadata lines
Expand Down
63 changes: 63 additions & 0 deletions testing/data/dummy_tjas/unsupported.tja
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// This song contains all unsupported metadata/commands.
TITLE:Test
TITLEJA:テスト
TITLEEN:Test
SUBTITLE:Test
SUBTITLEJA:テスト
SUBTITLEEN:Test
BPM:120
OFFSET:-1.00
DEMOSTART:1.00
GENRE:J-POP
SCOREMODE:1
WAVE:Test.ogg
MAKER:Test <https://example.com>
LYRICS:Test.vtt
SONGVOL:100
SEVOL:100
SIDE:1
LIFE:0
GAME:Taiko
HEADSCROLL:1
BGIMAGE:Test.png
BGMOVIE:Test.avi
MOVIEOFFSET:1.00
PREIMAGE:Test.png
TAIKOWEBSKIN:dir ../song_skins,name miku,song static,stage none,don fastscroll

COURSE:Oni
LEVEL:10
BALLOON:8,8
SCOREINIT:400
SCOREDIFF:100
BALLOONNOR:8,8
BALLOONEXP:10,10
BALLOONMAS:12,12
EXAM1:g,98,100,m
EXAM2:jp,1000,1150,m
EXAM3:jb,10,5,l
GAUGEINCR:Normal
TOTAL:200
HIDDENBRANCH:1
NOTESDESIGNER4:Test
NOTESDESIGNER3:Test
NOTESDESIGNER2:Test
NOTESDESIGNER1:Test
NOTESDESIGNER0:Test

#BMSCROLL
#HBSCROLL
#START
#SENOTECHANGE 3
1020304,
#LYRIC Test lyric
5000008,
#DIRECTION 2
6000008,
#SUDDEN 2 1
7000008,
#JPOSSCROLL 2 760 1
9000008,
#END

#NEXTSONG GO!GO!明るい社会,うるまでるび,バラエティ,GO!GO!明るい社会.ogg,560,160
1 change: 1 addition & 0 deletions testing/test_command_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@pytest.mark.parametrize('id_song,err_msg', [
['basic_song', None],
['basic_song_2P', None],
['unsupported', None],
['notes_double_kusudama', None],
['notes_hands', None],
['notes_sim_only', None],
Expand Down