mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
Update song_hash.py
This commit is contained in:
@@ -114,12 +114,16 @@ def build_song_hashes(output_dir=Path("cache")):
|
||||
tja = TJAParser(tja_path)
|
||||
all_notes = NoteList()
|
||||
diff_hashes = dict()
|
||||
|
||||
for diff in tja.metadata.course_data:
|
||||
diff_notes, _, _, _ = TJAParser.notes_to_position(TJAParser(tja.file_path), diff)
|
||||
diff_hashes[diff] = tja.hash_note_data(diff_notes)
|
||||
all_notes.play_notes.extend(diff_notes.play_notes)
|
||||
all_notes.bars.extend(diff_notes.bars)
|
||||
|
||||
try:
|
||||
for diff in tja.metadata.course_data:
|
||||
diff_notes, _, _, _ = TJAParser.notes_to_position(TJAParser(tja.file_path), diff)
|
||||
diff_hashes[diff] = tja.hash_note_data(diff_notes)
|
||||
all_notes.play_notes.extend(diff_notes.play_notes)
|
||||
all_notes.bars.extend(diff_notes.bars)
|
||||
except Exception as e:
|
||||
print(f"Failed to parse TJA {tja_path}: {e}")
|
||||
continue
|
||||
|
||||
if all_notes == []:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user