mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 03:30:13 +01:00
Fix various crashes
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user