mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
fix loading bug when songs dont parse
This commit is contained in:
@@ -125,7 +125,8 @@ def build_song_hashes(output_dir=Path("cache")):
|
|||||||
print(f"Failed to parse TJA {tja_path}: {e}")
|
print(f"Failed to parse TJA {tja_path}: {e}")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if all_notes == []:
|
if all_notes == NoteList():
|
||||||
|
print(tja_path)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
hash_val = tja.hash_note_data(all_notes)
|
hash_val = tja.hash_note_data(all_notes)
|
||||||
|
|||||||
@@ -1939,7 +1939,7 @@ class FileNavigator:
|
|||||||
# Create SongFile objects
|
# Create SongFile objects
|
||||||
for tja_path in sorted(tja_files):
|
for tja_path in sorted(tja_files):
|
||||||
song_key = str(tja_path)
|
song_key = str(tja_path)
|
||||||
if song_key not in self.all_song_files:
|
if song_key not in self.all_song_files and tja_path in global_data.song_paths:
|
||||||
song_obj = SongFile(tja_path, tja_path.name, texture_index)
|
song_obj = SongFile(tja_path, tja_path.name, texture_index)
|
||||||
song_obj.box.get_scores()
|
song_obj.box.get_scores()
|
||||||
for course in song_obj.tja.metadata.course_data:
|
for course in song_obj.tja.metadata.course_data:
|
||||||
@@ -1970,6 +1970,7 @@ class FileNavigator:
|
|||||||
self.new_items.append(SongFile(tja_path, tja_path.name, SongBox.DEFAULT_INDEX, name_texture_index=texture_index))
|
self.new_items.append(SongFile(tja_path, tja_path.name, SongBox.DEFAULT_INDEX, name_texture_index=texture_index))
|
||||||
self.all_song_files[song_key] = song_obj
|
self.all_song_files[song_key] = song_obj
|
||||||
|
|
||||||
|
if song_key in self.all_song_files:
|
||||||
content_items.append(self.all_song_files[song_key])
|
content_items.append(self.all_song_files[song_key])
|
||||||
|
|
||||||
self.directory_contents[dir_key] = content_items
|
self.directory_contents[dir_key] = content_items
|
||||||
|
|||||||
Reference in New Issue
Block a user