diff --git a/libs/file_navigator.py b/libs/file_navigator.py index c60a8c3..d79b8b5 100644 --- a/libs/file_navigator.py +++ b/libs/file_navigator.py @@ -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() diff --git a/libs/song_hash.py b/libs/song_hash.py index 34baf25..b81fe8b 100644 --- a/libs/song_hash.py +++ b/libs/song_hash.py @@ -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) diff --git a/libs/utils.py b/libs/utils.py index 27ba399..f333151 100644 --- a/libs/utils.py +++ b/libs/utils.py @@ -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 diff --git a/scenes/song_select.py b/scenes/song_select.py index b6d6b8e..d97dcd2 100644 --- a/scenes/song_select.py +++ b/scenes/song_select.py @@ -140,6 +140,8 @@ class SongSelectScreen(Screen): elif action == "select_song": current_song = self.navigator.get_current_item() if isinstance(current_song, Directory) and current_song.box.texture_index == 13: + if len(self.navigator.directory_contents[str(current_song.path)]) == 0: + return self.dan_transition.start() audio.stop_sound('bgm') return