修复部分音频无法成功切换的问题

This commit is contained in:
2025-02-09 17:12:57 +08:00
parent 159bc92e5e
commit e5d15d2d29

View File

@ -888,11 +888,12 @@ def tick():
except ValueError: except ValueError:
current_index = -1 current_index = -1
abs_path = song_list[current_index + 1] abs_path = song_list[current_index + 1]
music_file_without_endswith = abs_path.split("/")[-1].splite(".")[0] music_file_without_endswith = abs_path.split("/")[-1].split(".")[0]
music_playing = abs_path music_playing = abs_path
try: try:
lyric = lyrics.load_lyrics(f"{path}/{music_file_without_endswith}.lrc") lyric = lyrics.load_lyrics(f"{path}/{music_file_without_endswith}.lrc")
except: except Exception as e:
print(e)
lyric = {} lyric = {}
music_player.set_format_of_time( music_player.set_format_of_time(
lang.get(la, "ui.playing.text.time_format", lang.get(la, "ui.playing.text.time_format",
@ -913,7 +914,8 @@ def tick():
music_playing = abs_path music_playing = abs_path
try: try:
lyric = lyrics.load_lyrics(f"{path}/{music_file_without_endswith}.lrc") lyric = lyrics.load_lyrics(f"{path}/{music_file_without_endswith}.lrc")
except: except Exception as e:
print(e)
lyric = {} lyric = {}
except IndexError: except IndexError:
music_file_name = music_dir[0] music_file_name = music_dir[0]
@ -927,7 +929,8 @@ def tick():
lang.get(la, "ui.playing.text.time_format", lang.get(la, "ui.playing.text.time_format",
{"_music_": music_file_without_endswith})) {"_music_": music_file_without_endswith}))
playmusic(music_playing) playmusic(music_playing)
except: except Exception as e:
print(e)
pass pass
else: else:
playing_progress.state(["!disabled"]) playing_progress.state(["!disabled"])
@ -1151,7 +1154,7 @@ def download_version():
copy(version_json[get_treeview_index(version_list, version_download_choice)]["password"]) copy(version_json[get_treeview_index(version_list, version_download_choice)]["password"])
version = "4.0.7" version = "4.0.8"
poem = "" poem = ""
appdata = os.getenv("APPDATA") appdata = os.getenv("APPDATA")
make_resource() make_resource()