Fix various crashes

This commit is contained in:
Anthony Samms
2025-11-20 22:12:03 -05:00
parent 2cf3be9378
commit 3849e961d2
4 changed files with 9 additions and 13 deletions

View File

@@ -1235,7 +1235,7 @@ class FileNavigator:
for item in self.directory_contents[sibling_key]:
if not isinstance(item, Directory):
temp_items.append(item)
content_items = random.sample(temp_items, 10)
content_items = random.sample(temp_items, min(10, len(temp_items)))
if content_items == []:
self.go_back()

View File

@@ -114,13 +114,13 @@ def build_song_hashes(output_dir=Path("cache")):
global_data.total_songs = total_songs
for tja_path in files_to_process:
tja_path_str = str(tja_path)
current_modified = tja_path.stat().st_mtime
tja = TJAParser(tja_path)
all_notes = NoteList()
diff_hashes = dict()
try:
tja_path_str = str(tja_path)
current_modified = tja_path.stat().st_mtime
tja = TJAParser(tja_path)
all_notes = NoteList()
diff_hashes = dict()
for diff in tja.metadata.course_data:
diff_notes, branch_m, branch_e, branch_n = TJAParser.notes_to_position(TJAParser(tja.file_path), diff)
diff_hashes[diff] = tja.hash_note_data(diff_notes)

View File

@@ -31,12 +31,6 @@ def force_dedicated_gpu():
except Exception as e:
logger.error(e)
try:
# AMD PowerXpress
ctypes.windll.kernel32.SetEnvironmentVariableW("AMD_VULKAN_ICD", "DISABLE")
except Exception as e:
logger.error(e)
def rounded(num: float) -> int:
"""Round a number to the nearest integer"""
sign = 1 if (num >= 0) else -1